Load-Settings
This package loads a settings.js file on root directory and made it available everywhere by require("load-settings").
Instalation
npm install load-settings --save
How this works
First, inside your root directory create a file settings.js and inside of this file put your variables on a JSON document.
// settings.jsmoduleexports = AUTH: GITHUB: CLIENT_ID: processenvGITHUB_KEY CLIENT_SECRET: processenvGITHUB_SECRET CALLBACK_URL: processenvAPP_URL + 'auth/github/callback' SCOPE: "user" PROJECT_DIR: __dirname;
Then anytime you want your settings variables just use
var settings = ; var root_path = settingsPROJECT_DIR;