Skip to content

opentable/ot-node-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ot-node-env

Build Status NPM version Dependencies

Opentable helper for setting the node_env.

Hierarchy as follows:

  • NODE_ENV
  • /etc/node_env.json ( file with the following contents { "env": "myenv" })
  • specified fallback (e.g. local or dev)

Motivation: Some of the wrappers and up-scripts we are using are a PITA to thread environment variables through.

installation:

npm install ot-node-env

usage:

require('ot-node-env').env();
console.log(process.env.NODE_ENV);

// or alternatively

require('ot-node-env').env('/path/to/file.json')

// or

require('ot-node-env').env('/path/to/file.json', 'dev');

Running tests

npm install
npm test

About

ot-specific hierarchy for setting the NODE_ENV

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published