吕君喜 406d880ac6 first | %!s(int64=3) %!d(string=hai) anos | |
---|---|---|
.. | ||
README.md | %!s(int64=3) %!d(string=hai) anos | |
flags.json | %!s(int64=3) %!d(string=hai) anos | |
implementation.js | %!s(int64=3) %!d(string=hai) anos | |
index.js | %!s(int64=3) %!d(string=hai) anos | |
package.json | %!s(int64=3) %!d(string=hai) anos | |
polyfill.js | %!s(int64=3) %!d(string=hai) anos | |
shim.js | %!s(int64=3) %!d(string=hai) anos |
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.