Screen%20region%202014-09-18%20at%2017.37.07_large

Avishaan Sethi

Node.js Alternate Config File

An alternate config file in node for setting variables based on current env without the overhead of another library with more flexibility than a .json file.

Let me answer some questions to start with.

Why not just use a config.json file and then require that?

  1. You can't reference your NODE_ENV variable.
  2. You can't require any additional files. What if you want to use reuse a field in an existing library's config file or from your package.json!?
  3. . . .

Read More

Posted in: nodejshowto

October 19, 2014

Archive