"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm/lib/utils/read-local-package.js" (7 Feb 2017, 329 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 exports = module.exports = readLocalPkg
    2 
    3 var npm = require('../npm.js')
    4 var readJson = require('read-package-json')
    5 
    6 function 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 }