1 | module.exports = bin
|
2 |
|
3 | var npm = require("./npm.js")
|
4 |
|
5 | bin.usage = "npm bin\nnpm bin -g\n(just prints the bin folder)"
|
6 |
|
7 | function 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 | }
|