0.2.2 • Published 6 years ago

env-accessors v0.2.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

env-accessors

Build Status NPM version NPM downloads LICENSE

process.env accessor functions.

$ npm install env-accessors --save

API

.del

aliases: -

Delete given key from process.env.

del('DISABLED_SERVICES');
.get

aliases: -

Get given key's value from process.env.

get('DATABASE_NAME');
.has

aliases: contains

Whether process.env contains given key.

has('NEW_RELIC_LICENSE_KEY');
.missing

aliases: -

Whether given key is missing from process.env.

missing('NEW_RELIC_LICENSE_KEY');
.required

aliases: assert

Throw a ReferenceError if given key is missing from process.env and return given key's value from process.env otherwise.

required('NEW_RELIC_LICENSE_KEY');
.set

aliases: put

Set value for process.env[key].

set({ DATABASE_HOST: 'localhost' });

License

MIT