Socket
Socket
Sign inDemoInstall

node-environment-flags

Package Overview
Dependencies
69
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-environment-flags

> Polyfill/shim for `process.allowedNodeEnvironmentFlags`


Version published
Maintainers
1
Weekly downloads
1,464,322
decreased by-5.81%

Weekly downloads

Readme

Source

node-environment-flags

Polyfill/shim for process.allowedNodeEnvironmentFlags

semantic-release

node-environment-flags is a rough polyfill and shim for process.allowedNodeEnvironmentFlags, which was introduced in Node.js v10.10.0.

Table of Contents

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.

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.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

Maintainers

@boneskull

License

Copyright © 2018 Christopher Hiller. Licensed Apache-2.0.

FAQs

Last updated on 25 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc