@exan/envreader
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

.env-reader

Convenient way to deal with .env files

Usage

Find .env file in current or parent folders and add values to process.env: require('@exan/envreader').load();

Load .env file specified and add values to process.env: require('@exan/envreader').load('path/to/.env');

Find .env file in current or parent folders and return values require('@exan/envreader').getValues();

Load .env file specified and return values require('@exan/envreader').getValues('path/to/.env');

Example .env

KEY=VALUE # process.env.KEY === 'VALUE'

# tokens
DISCORD_TOKEN=token # process.env.KEY === 'token'
GITHUB_TOKEN=token2 # process.env.KEY === 'token2'

Source

https://github.com/Exanlv/.env-reader

Readme

Keywords

Package Sidebar

Install

npm i @exan/envreader

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

24.2 kB

Total Files

10

Last publish

Collaborators

  • exan