diff options
Diffstat (limited to 'lib/prefix.js')
-rw-r--r-- | lib/prefix.js | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/lib/prefix.js b/lib/prefix.js index fb20389c4..0a9914473 100644 --- a/lib/prefix.js +++ b/lib/prefix.js @@ -1,15 +1,8 @@ -module.exports = prefix - -var npm = require('./npm.js') -var output = require('./utils/output.js') - -prefix.usage = 'npm prefix [-g]' - -function prefix (args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false - } - if (!silent) output(npm.prefix) - process.nextTick(cb.bind(this, null, npm.prefix)) -} +const npm = require('./npm.js') +const output = require('./utils/output.js') +const usageUtil = require('./utils/usage.js') +const completion = require('./utils/completion/none.js') +const cmd = (args, cb) => prefix(args).then(() => cb()).catch(cb) +const usage = usageUtil('prefix', 'npm prefix [-g]') +const prefix = async (args, cb) => output(npm.prefix) +module.exports = Object.assign(cmd, { usage, completion }) |