1.0.0 • Published 8 years ago

node-env-match v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

node-env-match

NPM Version Travis Build

Utility to test the value of the NODE_ENV system variable.

Usage

Add node-env-match as a project dependency

$ npm install node-env-match --save

Require and use it is really simple

// Suppose you run your app with
// NODE_ENV=simple-test

var nodeEnvMatch = require('node-env-match');

// you can use a string argument
nodeEnvMatch("simple-test") // => true
nodeEnvMatch("test") // => false

// or a regular expression
nodeEnvMatch(/simple-test/) // => true
nodeEnvMatch(/test/) // => true

// or array of strings/reg-exp
// it returns true if at least one matches
nodeEnvMatch(['test',/test/]) // => true
nodeEnvMatch(['test',/tost/]) // => false

You can see more examples in test/node-env-match file.

Test

$ npm test

License

MIT © Andrea Tarquini