Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

@exan/envreader

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

Install

npm i @exan/envreader

DownloadsWeekly Downloads

2

Version

1.0.4

License

ISC

Unpacked Size

24.2 kB

Total Files

10

Last publish

Collaborators

  • avatar