current-pkg

0.1.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i current-pkg

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • kchan