1.0.0 • Published 8 years ago

pkg-entry v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

pkg-entry

NPM version Unix Build Status Windows Build Status Coveralls Status Dependency Status

expose jsnext:main or main properties from object, defaults to index.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