1.0.7 • Published 2 years ago

envn v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Envn

💨 Envn is a zero-dependency module that loads environment variables from a .env file into process.env.

Envn Envn Envn Envn

Install

$ npm install envn
// or via Yarn
$ yarn add envn

Usage

const envn = require('envn');

Methods && Examples

const config = {
  // prefix of start name of env or any file contains environnement variables
  prefix: '.env',

  // default: process.env.NODE_ENV
  // developement | production | test -> this will load file .env.developement
  mode: 'developement'
}

// Envn method loads variables into process.env and also returns an object
envn(config?: Object) : Object

// env file example
REDIS:
  API_KEY=xxxx
  
console.log(process.env.REDIS_API_KEY);

Notes

License

Released under the MIT license

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago