UNPKG

515 BJavaScriptView Raw
1module.exports = bin
2
3var npm = require('./npm.js')
4var osenv = require('osenv')
5var output = require('./utils/output.js')
6
7bin.usage = 'npm bin [--global]'
8
9function bin (args, silent, cb) {
10 if (typeof cb !== 'function') {
11 cb = silent
12 silent = false
13 }
14 var b = npm.bin
15 var PATH = osenv.path()
16
17 if (!silent) output(b)
18 process.nextTick(cb.bind(this, null, b))
19
20 if (npm.config.get('global') && PATH.indexOf(b) === -1) {
21 npm.config.get('logstream').write('(not in PATH env variable)\n')
22 }
23}