https://github.com/opentable/ot-node-env
ot-specific hierarchy for setting the NODE_ENV
https://github.com/opentable/ot-node-env
Last synced: 3 months ago
JSON representation
ot-specific hierarchy for setting the NODE_ENV
- Host: GitHub
- URL: https://github.com/opentable/ot-node-env
- Owner: opentable
- License: mit
- Created: 2015-02-17T12:01:58.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-18T11:13:43.000Z (over 10 years ago)
- Last Synced: 2025-01-28T23:09:51.129Z (4 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 0
- Watchers: 18
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ot-node-env
======================[](https://travis-ci.org/opentable/ot-node-env) [](http://badge.fury.io/js/ot-node-env) 
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
```