0.1.0 • Published 9 years ago
current-pkg v0.1.0
current-pkg

Load package.json from current work directory.
Install
$ npm install --save current-pkg
Usage
const currentPkg = require('current-pkg')
currentPkg()
/*
{
pkg: {name: 'packageName', version...}
}
*/
currentPkg(path.join(__dirname, '../another-package'))
/*
{
pkg: {name: 'otherPackageName', version...}
}
*/
// not found
currentPkg()
/*
{
error: new Error('Cannot find module ...')
}
*/
License
MIT © EGOIST
0.1.0
9 years ago