2011-11-21 18:48:45 +01:00
|
|
|
module.exports = prefix
|
|
|
|
|
2015-10-10 08:13:57 +02:00
|
|
|
var npm = require('./npm.js')
|
2016-06-24 22:43:51 +02:00
|
|
|
var output = require('./utils/output.js')
|
2011-11-21 18:48:45 +01:00
|
|
|
|
2015-10-10 08:13:57 +02:00
|
|
|
prefix.usage = 'npm prefix [-g]'
|
2011-11-21 18:48:45 +01:00
|
|
|
|
2012-07-17 20:37:39 +02:00
|
|
|
function prefix (args, silent, cb) {
|
2015-10-10 08:13:57 +02:00
|
|
|
if (typeof cb !== 'function') {
|
|
|
|
cb = silent
|
|
|
|
silent = false
|
|
|
|
}
|
2016-06-24 22:43:51 +02:00
|
|
|
if (!silent) output(npm.prefix)
|
2012-07-17 20:37:39 +02:00
|
|
|
process.nextTick(cb.bind(this, null, npm.prefix))
|
2011-11-21 18:48:45 +01:00
|
|
|
}
|