Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tag: v0.2.0
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (36 sloc) 1.45 KB

envious: environment variables made easy, fun, and finally profitable

envious makes it absurdly easy for you to configure your environment, so you can have a central place to define credentials and whatnot.


npm install envious

textbook example

put this in your pipe

var envious = require('envious');

envious.development = 
  "mongodb_hostname": "dev.local",
  "site_url": "",

envious.production = 
  "mongodb_hostname": "",
  "site_url": "",

envious.default_env = "development";

var env = envious.apply();


and smoke it

NODE_ENV=production node app.js


strict: strict environment checking

var env = envious.apply({strict: true});

When strict is on, it will throw an error if the environment does not exist. normally, it would simply fall back to the default.

strictProperties: if the current environment is missing properties that the default environment has, throw an error.

var env = envious.apply({strictProperties: true});

By default, properties not defined in the current environment will be copied from the default environment.


you have to run the tests a certain way.

  • normal.js: tests normal function. NODE_ENV=production node normal.js
  • default.js: tests the default environment feature. node default.js
  • strict.js: tests strict mode. NODE_ENV=bogus node strict.js
Jump to Line
Something went wrong with that request. Please try again.