Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bin.js « lib - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2e02617d35a790d1563393546bb78782b0fa80d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module.exports = bin

var npm = require('./npm.js')
var osenv = require('osenv')

bin.usage = 'npm bin [--global]'

function bin (args, silent, cb) {
  if (typeof cb !== 'function') {
    cb = silent
    silent = false
  }
  var b = npm.bin
  var PATH = osenv.path()

  if (!silent) console.log(b)
  process.nextTick(cb.bind(this, null, b))

  if (npm.config.get('global') && PATH.indexOf(b) === -1) {
    npm.config.get('logstream').write('(not in PATH env variable)\n')
  }
}