0.1.0 • Published 9 years ago

load-appconfig v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

load-appconfig

A too simple config loader.

Usage

appconfg.js:

var root = __dirname + '/';

module.exports = {
  appRoot       : root,
  publicDir     : 'public/',
  frontendMain  : 'index.html',
  dbConfigName  : 'dbConfig.js',
  listeningPort : process.env.PORT || '8000'
};

app.js:

var config = require('load-appconfig');

var appRoot = config.appRoot;
var dbConfig = require(appRoot + config.dbConfigName);

No paths needed to load config.

Prerequisites

  • Node.js
  • File named appConfig.js in the root of your node app

Installation

$ npm install load-appconfig