UNPKG

490 BJavaScriptView Raw
1module.exports = bin
2
3var npm = require("./npm.js")
4
5bin.usage = "npm bin\nnpm bin -g\n(just prints the bin folder)"
6
7function bin (args, silent, cb) {
8 if (typeof cb !== "function") cb = silent, silent = false
9 var b = npm.bin
10 , PATH = (process.env.PATH || "").split(":")
11
12 if (!silent) console.log(b)
13 process.nextTick(cb.bind(this, null, b))
14
15 if (npm.config.get("global") && PATH.indexOf(b) === -1) {
16 npm.config.get("logstream").write("(not in PATH env variable)\n")
17 }
18}