pkg-entry
v1.0.0
Published
expose `jsnext:main` or `main` properties from object, defaults to `index.js`
Downloads
5
Maintainers
Readme
pkg-entry
expose
jsnext:main
ormain
properties from object, defaults toindex.js
Install
npm install --save pkg-entry
Usage
import pkgEntry from 'pkg-entry';
const main = { main: './main.js' };
pkgEntry(main); // ./main.js
const jsnext = { 'jsnext:main': './jsnext.js', main: './jsnext.es5.js' };
pkgEntry(jsnext); // ./jsnext.js
const defaults = {};
pkgEntry(defaults); // index.js
API
pkgEntry(pkg)
pkg
Required
Type: Object
JSON from package.json
.
License
MIT © Vladimir Starkov