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

Package detail

@zaeny/env

azizzaeny16GPL-3.01.0.5

read .env files

.env, env, environment, env variable

readme

@zaeny/env

npm version npm downloads

Reading .env files

Getting Started

 npm install @zaeny/env

Example create .env files key=value =" and ='' or =

touch .env
cat > .env <<'EOL'
FOO="Bar"
TEST=DATA
BAR='apapa'
EOL

usage:

var {env} = require('@zaeny/env');
// or
var {env} = await import('@zaeny/env');
env()

/*
  { FOO: 'Bar', TEST: 'DATA', BAR: 'apapa'}  
  added to process.env[]
*/

// select different files
env('./environment'); 

Documentation

see it here index.md

Changes

  • [1.0.0] initial release, add read double quote
  • [1.0.1] add information update repositry, issues, keywords and so on
  • [1.0.2] fix cannot get value from env that contain = like uri ?auth=admin&foo=bar
  • [1.0.3] refactor, move to new repository composable
  • [1.0.5] fix readme repository home