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: 27ca7b4e39537613808948ee37c844bfc5266dc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
exports = module.exports = readLocalPkg

var npm = require('../npm.js')
var 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)
  })
}