1module.exports = root 2 3const npm = require('./npm.js') 4const output = require('./utils/output.js') 5 6root.usage = 'npm root [-g]' 7 8function root (args, silent, cb) { 9 if (typeof cb !== 'function') { 10 cb = silent 11 silent = false 12 } 13 if (!silent) output(npm.dir) 14 process.nextTick(cb.bind(this, null, npm.dir)) 15} 16