1 | module.exports = bin
|
2 |
|
3 | var npm = require('./npm.js')
|
4 | var osenv = require('osenv')
|
5 | var output = require('./utils/output.js')
|
6 |
|
7 | bin.usage = 'npm bin [--global]'
|
8 |
|
9 | function 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 | }
|