0.1.0 • Published 9 years ago

current-pkg v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

current-pkg NPM version NPM downloads Build Status

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