吕君喜 406d880ac6 first | il y a 3 ans | |
---|---|---|
.. | ||
README.md | il y a 3 ans | |
flags.json | il y a 3 ans | |
implementation.js | il y a 3 ans | |
index.js | il y a 3 ans | |
package.json | il y a 3 ans | |
polyfill.js | il y a 3 ans | |
shim.js | il y a 3 ans |
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.
Requires Node.js v6.0.0 or newer.
$ npm i node-environment-flags
If the current Node.js version is v10.10.0 or newer, the native implementation will be provided instead.
const nodeEnvironmentFlags = require('node-environment-flags');
nodeEnvironmentFlags.has('--require'); // true
require('node-environment-flags/shim')();
process.allowedNodeEnvironmentFlags.has('--require'); // true
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.Copyright © 2018 Christopher Hiller. Licensed Apache-2.0.