confectioner

0.1.2 • Public • Published

confectioner Version Badge

build status dependency status dev dependency status license

npm badge

Simpliest configuration builder which used the environment.

Installation

npm install confectioner --save

Example

// example.js
 
var confectioner = require('confectioner');
 
var config = confectioner({
    env: { envname: 'NODE_ENV', defaultValue: 'development' },
    hostname: { envname: 'MY_HOST', defaultValue: 'localhost' },
    port: { envname: 'MY_PORT', defaultValue: 1337, type: 'int' },
    baseuri: { envname: 'MY_BASEURI', defaultValue: '/myapp' }
});
 
console.log(config.getValuesMap());
 
// $ NODE_ENV=production MY_PORT=80 node --harmony example.js
// { env: 'production',
//   hostname: 'localhost',
//   port: '80',
//   baseuri: '/myapp' }
 

API

API documentation

Tests

npm test

Release History

  • 0.1.0 Initial release

Credits

License

MIT

Package Sidebar

Install

npm i confectioner

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • enten