> Polyfill/shim for `process.allowedNodeEnvironmentFlags`
npm install node-environment-flags> Polyfill/shim for process.allowedNodeEnvironmentFlags

node-environment-flags is a rough polyfill and shim for process.allowedNodeEnvironmentFlags, which was introduced in Node.js v10.10.0.
- Install
- Usage
- Maintainers
- Contribute
- License
Requires Node.js v6.0.0 or newer.
``shell`
$ npm i node-environment-flags
If the current Node.js version is v10.10.0 or newer, the native implementation will be provided instead.
`js
const nodeEnvironmentFlags = require('node-environment-flags');
nodeEnvironmentFlags.has('--require'); // true
`
`js
require('node-environment-flags/shim')();
process.allowedNodeEnvironmentFlags.has('--require'); // true
`
- This module approximates what process.allowedNodeEnvironmentFlags provides in versions of Node.js prior to v10.10.0. Since process.allowedNodeEnvironmentFlags is based on NODE_OPTIONS` (introduced in v8.0.0), the set of supported flags for versions older than v8.0.0 is highly theoretical.
- Version ranges are matched using semver.
- This module is granular to the minor Node.js version number; patch version numbers are not considered.
- Results for unmaintained (odd) versions of Node.js are based on data for the most recent LTS version; e.g., running this module against Node.js v7.10.0 will yield the same results as would v6.14.0.
- Prior art: @ljharb's util.promisify
Copyright © 2018 Christopher Hiller. Licensed Apache-2.0.