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

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

var npm = require("../npm")
  , output = require("./utils/output")
  , log = require("./utils/log")

root.usage = "npm root\nnpm root -g\n(just prints the root folder)"

function root (args, cb) {
  output.write(npm.dir, cb)
  var rp = require.paths.concat(module.paths)
  if (rp.indexOf(npm.dir) === -1) {
    output.write("(not in NODE_PATH env variable)"
                ,npm.config.get("logfd"))
  }
}