Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

envir

coderaiser2.3kMIT3.0.3

get npm env variables from package.json

readme

Envir NPM version Build Status Coverage Status

Get npm env variables from package.json.

Install

npm i envir --save

How to use?

import envir from 'envir';
const {env, cwd} = process;

envir(env.PATH, cwd(), require('./package'));
// returns
({
    npm_package_config_hello: 'world',
    PATH: '/home/coderaiser/envir/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
    npm_package_version: '1.0.0',
    npm_package_name: 'environ',
});

License

MIT

changelog

2025.02.18, v3.0.3

fix:

  • 27ea432 envir: ESM

2025.02.18, v3.0.2

feature:

  • 2827817 convert to ESM

2025.02.12, v3.0.1

fix:

  • a48595e lint

2025.02.12, v3.0.0

feature:

  • adce66a envir: drop support of node < 18
  • 7869893 envir: try-catch v3.0.1
  • e1da13d envir: nodemon v3.1.9
  • 344bec7 envir: supertape v10.10.0
  • 2b8dfbf envir: c8 v10.1.3
  • e7ef3ad envir: eslint-plugin-n v17.15.1
  • 6dbb472 envir: all-object-keys v3.0.0
  • f734a6f envir: madrun v10.2.5
  • 2f251f5 envir: eslint-plugin-putout v24.0.3
  • 9beead1 envir: eslint v9.20.1
  • d3f4a9c envir: putout v38.1.2

2019.12.21, v2.0.1

feature:

  • (package) jessy v3.0.0

2019.11.21, v2.0.0

feature:

  • (envir) drop support of node < 8
  • (package) nodemon v2.0.0
  • (package) eslint v6.6.0
  • (package) nyc v14.1.1
  • (package) all-object-keys v2.0.0
  • (package) redrun v6.0.0
  • (package) coveralls v3.0.0

2017.09.01, v1.0.1

fix:

  • (package) environ -> envir