吕君喜 406d880ac6 first | преди 3 години | |
---|---|---|
.. | ||
README.md | преди 3 години | |
flags.json | преди 3 години | |
implementation.js | преди 3 години | |
index.js | преди 3 години | |
package.json | преди 3 години | |
polyfill.js | преди 3 години | |
shim.js | преди 3 години |
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.