@glhrmoura/environment
v0.0.5
Published
An efficient Node library for managing and setting environment variables.
Downloads
6
Maintainers
Readme
Environment
An efficient Node library for managing and setting environment variables.
Install
$ yarn add @glhrmoura/environment
or
$ npm install @glhrmoura/environment
Usage
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