match-env

1.3.0 • Public • Published

match-env

Use an inline JavaScript expression to test environment variables.

Install

npm install match-env --save-dev
# Or
yarn add match-env --dev

Usage

Detection Mode

match-env "NODE_ENV=='test' && BUILD_TARGET!='node'" && echo yes || echo no

# build or noop
match-env 'CI==`true`' && yarn build || ':'

# handle `undefined`, same as `(process.env.FOO || globalThis.FOO)==`
match-env 'FOO==1' && yarn build || ':'

Call Mode

match-env 'FOO==1' -- yarn build

Readme

Keywords

none

Package Sidebar

Install

npm i match-env

Weekly Downloads

0

Version

1.3.0

License

MIT

Unpacked Size

6.13 kB

Total Files

8

Last publish

Collaborators

  • ambarli