1exports = module.exports = readLocalPkg 2 3var npm = require('../npm.js') 4var readJson = require('read-package-json') 5 6function readLocalPkg (cb) { 7 if (npm.config.get('global')) return cb() 8 var path = require('path') 9 readJson(path.resolve(npm.prefix, 'package.json'), function (er, d) { 10 return cb(er, d && d.name) 11 }) 12} 13