Skip to content

wilmoore/node-env-allowed

Repository files navigation

env-allowed

Build Status NPM version NPM downloads LICENSE

Whether an environment variable's value is contained within an allow list. Allow list is provided by a comma-separated environment variable value.

$ npm install env-allowed --save

Example

Start node or your program with a value that is in the allow list.
NODE_ENV=developent node
Create a comma-separated allow list.
process.env.ENVIRONMENTS = 'development,test';
Validate that the current NODE_ENV is within the allow list.
allowed('ENVIRONMENTS');
// true

License

MIT

About

Whether an environment varaible's value is contained within an allow list. Allow list is provided by a comma-separated environment variable value.

Resources

License

Stars

Watchers

Forks

Packages

No packages published