node-environment-flags

2020-01-14

node-environment-flags

> Polyfill/shim for process.allowedNodeEnvironmentFlags

node-environment-flags

Polyfill/shim for process.allowedNodeEnvironmentFlags

semantic-release

node-environment-flagsis a roughpolyfill and shim for process.allowedNodeEnvironmentFlags, which was introduced in Node.js v10.10.0.

Table of Contents

  • Install
  • Usage
  • Maintainers
  • Contribute
  • License

Install

Requires Node.js v6.0.0 or newer.

$ npm i node-environment-flags

Usage

If the current Node.js version is v10.10.0 or newer, the native implementation will be provided instead.

As Polyfill (Recommended)

const nodeEnvironmentFlags = require('node-environment-flags');

nodeEnvironmentFlags.has('--require'); // true

As Shim

require('node-environment-flags/shim')();

process.allowedNodeEnvironmentFlags.has('--require'); // true

Notes

  • This module approximates what process.allowedNodeEnvironmentFlagsprovides in versions of Node.js prior to v10.10.0. Since process.allowedNodeEnvironmentFlagsis 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 minorNode.js version number; patchversion 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

Maintainers

@boneskull

License

Copyright © 2018 Christopher Hiller. Licensed Apache-2.0.

以上是 node-environment-flags 的使用教程帮助文档。


上一篇:@babel/helper-fixtures
下一篇:3d-bin-packing
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部