https://github.com/kwhitley/env-autoload
Automatically loads env file when NODE_ENV !== 'production'.
https://github.com/kwhitley/env-autoload
Last synced: 3 months ago
JSON representation
Automatically loads env file when NODE_ENV !== 'production'.
- Host: GitHub
- URL: https://github.com/kwhitley/env-autoload
- Owner: kwhitley
- License: mit
- Created: 2018-06-13T19:05:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-26T05:29:44.000Z (almost 7 years ago)
- Last Synced: 2024-04-14T05:46:28.572Z (about 1 year ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
.env autoloader
=======[](https://www.npmjs.com/package/env-autoload)
[](https://www.npmjs.com/package/env-autoload)
[](https://travis-ci.org/kwhitley/env-autoload)
[](https://coveralls.io/github/kwhitley/env-autoload?branch=master)
[](https://www.npmjs.com/package/env-autoload)## Why?
Because who wants bootstrap files in their boilerplate/templates?
This is really just a code-smell implementation fix for using the
wonderful [dotenv](https://www.npmjs.com/package/dotenv) library.## Usage
#### .env
```bash
TEST='foo bar baz'
```#### index.js (server)
```js
import env from 'env-autoload' // require('env-autoload') works fine tooprocess.env.TEST === 'foo bar baz' // true
env.TEST === 'foo bar baz' // also true (convenience export)
```## Changelog
- 1.1.0 - added process.env as convenience export (as well as to pass linting tests)