0.2.1 • Published 10 years ago

plain-conf v0.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

plain-conf

plain-conf is just a loader for your configuration files.

npm version Build Status

Config

Put all your configurations files (production.js, development.js, etc.) under the config/ directory in your project root and require them via require(‘plain-conf’). According to your current NODE_ENV plain-conf will load the configuration. Your configuration file is just a plain JSON Blob or a node module.

Example:

// If NODE_ENV is set to production plain-conf will lookup the
// the ./config/production.(js|json) configuration file.
// For NODE_ENV set to development it will lookup the
// ./config/development.(js|json) configuration file, etc.
const config = require('plain-conf');

Check for debug / development environment

Check if your configuration environment should be debuggable. isDebug will return true unless NODE_ENV=production.

Example:

// For NODE_ENV=production.
const debug = require('plain-conf').isDebug; // false

// For NODE_ENV=development.
const debug = require('plain-conf').isDebug; // true

// Or use the __DEV__ alias.
const __DEV__ = require('plain-conf').__DEV__;
0.2.1

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago