@glhrmoura/environment

0.0.5 • Public • Published

Environment

NPM Version License

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

MIT

Copyright (c) Guilherme Moura

Package Sidebar

Install

npm i @glhrmoura/environment

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

5.06 kB

Total Files

4

Last publish

Collaborators

  • glhrmoura