https://github.com/akashbabu/lib-env
A nodejs library for managing easily with ENV
https://github.com/akashbabu/lib-env
env environment nodejs-library
Last synced: 3 months ago
JSON representation
A nodejs library for managing easily with ENV
- Host: GitHub
- URL: https://github.com/akashbabu/lib-env
- Owner: AkashBabu
- License: mit
- Created: 2018-06-03T08:37:06.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-04T18:02:35.000Z (almost 7 years ago)
- Last Synced: 2025-01-19T18:53:30.117Z (5 months ago)
- Topics: env, environment, nodejs-library
- Language: JavaScript
- Size: 127 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGE_LOG.md
- License: LICENSE
Awesome Lists containing this project
README
# lib-env
An Efficient nodejs library for managing NODE_ENV comparisonsAll the below comparisons are executed only once at the begining of the application and the results are saved. Hence making the usage more efficient
## Usage
```javascript
import { IsENVTest } from "lib-env";// By using this library you may change the below code
if(process.env.NODE_ENV === "test") { ... }// To
if(IsENVTest) { ... }```
## Properties
* **IsENVTest** => returns `true` if NODE_ENV=test
* **IsENVDev** => returns `true` if NODE_ENV=dev
* **IsENVStag** => returns `true` if NODE_ENV=stag
* **IsENVProd** => returns `true` if NODE_ENV=prod## Methods
* **GetENV()**
Returns the Current NODE_ENV set. By Default it is set to `dev`