0.0.5 • Published 2 years ago
@glhrmoura/environment v0.0.5
Environment
An efficient Node library for managing and setting environment variables.
Install
$ yarn add @glhrmoura/environmentor
$ npm install @glhrmoura/environmentUsage
Basic
The library is quite simple to use, we just need to import and call a configuration function. The configuration will look for a .env file at the same level as the file calling it.
import { config } from '@glhrmoura/environment';
config();Passing envPath property
The envPath property refers to the path of the .env file:
import { config } from '@glhrmoura/environment';
config({ envPath: '/path/envFile' });Passing envPath as a list
The envPath property can also be in the form of a list, receiving multiple paths for different files:
import { config } from '@glhrmoura/environment';
config({ envPath: ['/path/envFileDev', '/path/envFileProd'] });License
Copyright (c) Guilherme Moura