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

read-local-package.js « utils « lib - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ca6d613210f1da6380e554de554783426a12326a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
exports = module.exports = readLocalPkg

var npm = require("../npm.js")
  , readJson = require("read-package-json")

function readLocalPkg (cb) {
  if (npm.config.get("global")) return cb()
  var path = require("path")
  readJson(path.resolve(npm.prefix, "package.json"), function (er, d) {
    return cb(er, d && d.name)
  })
}