load-settings

0.0.2 • Public • Published

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.js
module.exports = {
  AUTH: {
    GITHUB: {
      CLIENT_ID: process.env.GITHUB_KEY,
      CLIENT_SECRET: process.env.GITHUB_SECRET,
      CALLBACK_URL: process.env.APP_URL + 'auth/github/callback',
      SCOPE: ["user"]
    }
  },
  PROJECT_DIR: __dirname
};

Then anytime you want your settings variables just use

  var settings = require("load-settings");
  var root_path = settings.PROJECT_DIR; 

Readme

Keywords

Package Sidebar

Install

npm i load-settings

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • xfilipe