node/deps/npm/lib/bin.js
Rebecca Turner c54d057598 deps: upgrade to npm 2.10.1
PR-URL: https://github.com/nodejs/io.js/pull/1763
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-05-23 19:48:00 -04:00

20 lines
496 B
JavaScript

module.exports = bin
var npm = require("./npm.js")
var osenv = require("osenv")
bin.usage = "npm bin\nnpm bin -g\n(just prints the bin folder)"
function bin (args, silent, cb) {
if (typeof cb !== "function") cb = silent, silent = false
var b = npm.bin
, 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")
}
}