Package Exports
- npm-package-env
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (npm-package-env) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
npm-package-env
conveniently get
npm_package_
variables using property accessors
installation
npm i npm-package-env -S
usage
my-npm-script.js
const env = require('npm-package-env')._in('npm_package_config');
console.log(env['dev-server'].port._as('string')); // -> 7777
package.json
{
"name": "my-package",
"config": {
"dev-server": {
"port": 7777
}
},
"scripts": {
"start": "my-npm-script"
}
}