mirror of
https://github.com/nodejs/node.git
synced 2025-05-16 15:41:42 +00:00

PR-URL: https://github.com/nodejs/node/pull/3310 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
15 lines
279 B
JavaScript
15 lines
279 B
JavaScript
module.exports = root
|
|
|
|
var npm = require('./npm.js')
|
|
|
|
root.usage = 'npm root [-g]'
|
|
|
|
function root (args, silent, cb) {
|
|
if (typeof cb !== 'function') {
|
|
cb = silent
|
|
silent = false
|
|
}
|
|
if (!silent) console.log(npm.dir)
|
|
process.nextTick(cb.bind(this, null, npm.dir))
|
|
}
|