{"_id":"configr","_rev":"27861","name":"configr","description":"A library parse JSON configuration files.","dist-tags":{"latest":"0.4.0"},"maintainers":[{"name":"antz29","email":"jp@antz29.com"}],"time":{"modified":"2021-06-03T10:04:01.000Z","created":"2011-11-14T10:56:33.257Z","0.4.0":"2014-09-08T00:26:30.269Z","0.3.1":"2014-09-08T00:02:22.512Z","0.3.0":"2014-09-07T23:22:44.215Z","0.2.2":"2012-04-07T21:02:16.202Z","0.2.1":"2012-04-05T15:53:06.701Z","0.2.0":"2012-04-05T14:33:06.367Z","0.1.1":"2012-03-06T09:26:16.813Z","0.1.0":"2011-11-14T10:56:33.257Z"},"users":{},"author":{"name":"John Le Drew","email":"jp@antz29.com","url":"http://antz29.com"},"repository":{"type":"git","url":"git:/git://github.com/antz29/node-configr.git"},"versions":{"0.4.0":{"author":{"name":"John Le Drew","email":"jp@antz29.com","url":"http://antz29.com"},"name":"configr","description":"A library parse JSON configuration files.","keywords":["configuration","json"],"version":"0.4.0","homepage":"http://github.com/antz29/node-configr","repository":{"type":"git","url":"git:/git://github.com/antz29/node-configr.git"},"bugs":{"url":"http://github.com/antz29/node-configr/issues","email":"configr-bugs@antz29.com"},"engines":{"node":"~0.10.0"},"directories":{"lib":"./src/lib"},"main":"./src/lib/configr.js","dependencies":{"underscore":"*"},"devDependencies":{"expresso":"*"},"scripts":{"test":"./node_modules/expresso/bin/expresso"},"maintainers":[{"name":"antz29","email":"jp@antz29.com"}],"gitHead":"78767b9de1432090e16770088abef95b4973c097","_id":"configr@0.4.0","_shasum":"3aea7211875ea079acafd61cce0915616e8d5552","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"antz29","email":"jp@antz29.com"},"dist":{"shasum":"3aea7211875ea079acafd61cce0915616e8d5552","size":2985,"noattachment":false,"key":"/configr/-/configr-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/configr/download/configr-0.4.0.tgz"},"publish_time":1410135990269,"_cnpm_publish_time":1410135990269,"_hasShrinkwrap":false},"0.3.1":{"author":{"name":"John Le Drew","email":"jp@antz29.com","url":"http://antz29.com"},"name":"configr","description":"A library parse JSON configuration files.","keywords":["configuration","json"],"version":"0.3.1","homepage":"http://github.com/antz29/node-configr","repository":{"type":"git","url":"git:/git://github.com/antz29/node-configr.git"},"bugs":{"url":"http://github.com/antz29/node-configr/issues","email":"configr-bugs@antz29.com"},"engines":{"node":"~0.10.0"},"directories":{"lib":"./src/lib"},"main":"./src/lib/configr.js","dependencies":{"underscore":"*"},"devDependencies":{"expresso":"*"},"scripts":{"test":"./node_modules/expresso/bin/expresso"},"maintainers":[{"name":"antz29","email":"jp@antz29.com"}],"gitHead":"10e5343912a954513f627661101b9d5abaee4536","_id":"configr@0.3.1","_shasum":"5c3115a918937fc83d908d6ec96c5479bc69b538","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"antz29","email":"jp@antz29.com"},"dist":{"shasum":"5c3115a918937fc83d908d6ec96c5479bc69b538","size":3225,"noattachment":false,"key":"/configr/-/configr-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/configr/download/configr-0.3.1.tgz"},"publish_time":1410134542512,"_cnpm_publish_time":1410134542512,"_hasShrinkwrap":false},"0.3.0":{"author":{"name":"John Le Drew","email":"jp@antz29.com","url":"http://antz29.com"},"name":"configr","description":"A library parse JSON configuration files.","keywords":["configuration","json"],"version":"0.3.0","homepage":"http://github.com/antz29/node-configr","repository":{"type":"git","url":"git:/git://github.com/antz29/node-configr.git"},"bugs":{"url":"http://github.com/antz29/node-configr/issues","email":"configr-bugs@antz29.com"},"engines":{"node":"~0.10.0"},"directories":{"lib":"./src/lib"},"main":"./src/lib/configr.js","dependencies":{"underscore":"*"},"devDependencies":{"expresso":"*"},"scripts":{"test":"./node_modules/expresso/bin/expresso"},"maintainers":[{"name":"antz29","email":"jp@antz29.com"}],"gitHead":"4b639a4632eed2274bc709a893c6ce100bbf9f30","_id":"configr@0.3.0","_shasum":"1db9101063a8366b429fc875aad889c0cb15d442","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"antz29","email":"jp@antz29.com"},"dist":{"shasum":"1db9101063a8366b429fc875aad889c0cb15d442","size":3706,"noattachment":false,"key":"/configr/-/configr-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/configr/download/configr-0.3.0.tgz"},"publish_time":1410132164215,"_cnpm_publish_time":1410132164215,"_hasShrinkwrap":false},"0.2.2":{"author":{"name":"John Le Drew","email":"jp@antz29.com","url":"http://antz29.com"},"name":"configr","description":"A library parse JSON configuration files.","keywords":["configuration","json"],"version":"0.2.2","homepage":"http://github.com/antz29/node-configr","repository":{"type":"git","url":"git:/git://github.com/antz29/node-configr.git"},"bugs":{"email":"configr-bugs@antz29.com","url":"http://github.com/antz29/node-configr/issues"},"engines":{"node":">=0.6.0"},"directories":{"lib":"./src/lib"},"main":"./src/lib/configr.coffee","dependencies":{"underscore":"*","coffee-script":"*"},"devDependencies":{"expresso":"*"},"scripts":{"test":"./node_modules/expresso/bin/expresso"},"_npmUser":{"name":"antz29","email":"jp@antz29.com"},"_id":"configr@0.2.2","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"050b40413fdbedb4148dbf7d5a00d1beaf5527b3","size":10240,"noattachment":false,"key":"/configr/-/configr-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/configr/download/configr-0.2.2.tgz"},"maintainers":[{"name":"antz29","email":"jp@antz29.com"}],"publish_time":1333832536202,"_cnpm_publish_time":1333832536202,"_hasShrinkwrap":false},"0.2.1":{"author":{"name":"John Le Drew","email":"jp@antz29.com","url":"http://antz29.com"},"name":"configr","description":"A library parse JSON configuration files.","keywords":["configuration","json"],"version":"0.2.1","homepage":"http://github.com/antz29/node-configr","repository":{"type":"git","url":"git:/git://github.com/antz29/node-configr.git"},"bugs":{"email":"configr-bugs@antz29.com","url":"http://github.com/antz29/node-configr/issues"},"engines":{"node":">=0.6.0"},"directories":{"lib":"./src/lib"},"main":"./src/lib/configr.coffee","dependencies":{"underscore":"*","coffee-script":"*"},"devDependencies":{"expresso":"*"},"scripts":{"test":"./node_modules/expresso/bin/expresso"},"_npmUser":{"name":"antz29","email":"jp@antz29.com"},"_id":"configr@0.2.1","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"f0568ed7c437d00f6f487e93d339ddfc05f1b647","size":10240,"noattachment":false,"key":"/configr/-/configr-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/configr/download/configr-0.2.1.tgz"},"maintainers":[{"name":"antz29","email":"jp@antz29.com"}],"publish_time":1333641186701,"_cnpm_publish_time":1333641186701,"_hasShrinkwrap":false},"0.2.0":{"author":{"name":"John Le Drew","email":"jp@antz29.com","url":"http://antz29.com"},"name":"configr","description":"A library parse JSON configuration files and monitor for changes.","keywords":["configuration","json"],"version":"0.2.0","homepage":"http://github.com/antz29/node-configr","repository":{"type":"git","url":"git:/git://github.com/antz29/node-configr.git"},"bugs":{"email":"configr-bugs@antz29.com","url":"http://github.com/antz29/node-configr/issues"},"engines":{"node":">=0.6.0"},"directories":{"lib":"./src/lib"},"main":"./src/lib/configr.coffee","dependencies":{"underscore":"*","coffee-script":"*"},"devDependencies":{"expresso":"*"},"scripts":{"test":"./node_modules/expresso/bin/expresso"},"_npmUser":{"name":"antz29","email":"jp@antz29.com"},"_id":"configr@0.2.0","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"c8afa455711ea9a89a891a3f87f7d0c5aac0da9f","size":10240,"noattachment":false,"key":"/configr/-/configr-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/configr/download/configr-0.2.0.tgz"},"maintainers":[{"name":"antz29","email":"jp@antz29.com"}],"publish_time":1333636386367,"_cnpm_publish_time":1333636386367,"_hasShrinkwrap":false},"0.1.1":{"author":{"name":"John Le Drew","email":"jp@antz29.com","url":"http://antz29.com"},"name":"configr","description":"A library parse JSON configuration files and monitor for changes.","keywords":["configuration","json"],"version":"0.1.1","homepage":"http://github.com/antz29/node-configr","repository":{"type":"git","url":"git:/git://github.com/antz29/node-configr.git"},"bugs":{"email":"configr-bugs@antz29.com","url":"http://github.com/antz29/node-configr/issues"},"engines":{"node":">=0.6.0"},"directories":{"lib":"./src/lib"},"main":"./src/lib/configr.js","dependencies":{"underscore":">=1.2.1"},"devDependencies":{"expresso":">=0.9.0","linter":">=0.0.7"},"scripts":{"test":"./node_modules/expresso/bin/expresso"},"_npmUser":{"name":"antz29","email":"jp@antz29.com"},"_id":"configr@0.1.1","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"9d585b8db792ced65d4ff57b755fd5e33253d075","size":10240,"noattachment":false,"key":"/configr/-/configr-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/configr/download/configr-0.1.1.tgz"},"maintainers":[{"name":"antz29","email":"jp@antz29.com"}],"publish_time":1331025976813,"_cnpm_publish_time":1331025976813,"_hasShrinkwrap":false},"0.1.0":{"author":{"name":"John Le Drew","email":"jp@antz29.com","url":"http://antz29.com"},"name":"configr","description":"A library parse JSON configuration files and monitor for changes.","keywords":["configuration","json"],"version":"0.1.0","homepage":"http://github.com/antz29/node-configr","repository":{"type":"git","url":"git:/git://github.com/antz29/node-configr.git"},"bugs":{"email":"configr-bugs@antz29.com","url":"http://github.com/antz29/node-configr/issues"},"engines":{"node":">=0.6.0"},"directories":{"lib":"./src/lib"},"main":"./src/lib/configr.js","dependencies":{"underscore":">=1.2.1"},"devDependencies":{"expresso":">=0.9.0","linter":">=0.0.7"},"scripts":{"test":"./node_modules/expresso/bin/expresso"},"_npmUser":{"name":"antz29","email":"jp@antz29.com"},"_id":"configr@0.1.0","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"a0041d88d28d8d0bd7694a88b6c90ce248cd1b2a","size":10240,"noattachment":false,"key":"/configr/-/configr-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/configr/download/configr-0.1.0.tgz"},"maintainers":[{"name":"antz29","email":"jp@antz29.com"}],"publish_time":1321268193257,"_cnpm_publish_time":1321268193257,"_hasShrinkwrap":false}},"readme":"# node-configr - Configure your apps\n\n* master [![Build Status](https://secure.travis-ci.org/antz29/node-configr.png?branch=master)](http://travis-ci.org/antz29/node-configr)\n* develop [![Build Status](https://secure.travis-ci.org/antz29/node-configr.png?branch=develop)](http://travis-ci.org/antz29/node-configr)\n\n## Installation\n\n    npm install configr\n\n## What's it do?\n\nIt allows you to parse and merge multiple JSON configuration files (allowing \nyou to create environment specific configuration) and then access your configuration\nthrough a simple interface.\n\n## Config files\n\nYour applications configuration takes the form of simple JSON files. You create a directory\nto store your config files, the config files stored in the root are merged and form the 'base'\nconfiguration that is shares between all environments.\n\nTo create environment specific overrides you create sub directories, for each environment, and\nplace the configuration files in the there for each environment. For example, you start off with a\nconfig dir, and in there you have 'general.js' and 'db.js' files. See below\n\n    // general.js\n    module.exports = {\n        \"app_name\" : \"test_app\",\n        \"hawtness\" : \"extreme\"\n    }\n\n    // db.js\n    module.exports = {\n        \"host\" : \"127.0.0.1\",\n        \"user\" : \"myuser\",\n        \"pass\" : \"mypass\",\n        \"db\"   : \"mydb\"\n    }\n\nThese files are merged into an internal structure:\n\n    {\n        \"general\" : {\n            \"app_name\" : \"test_app\",\n            \"hawtness\" : \"extreme\"\n        },\n\n        \"db\" : {\n            \"host\" : \"127.0.0.1\",\n            \"user\" : \"myuser\",\n            \"pass\" : \"mypass\",\n            \"db\"   : \"mydb\"\n        }\n    }\n\nYou can then create environment specific config overrides; let's create a dev environment; create \na folder called 'dev' in the config dir, and we add a db.js file with specific overrides for \nthe dev environment. \n\n     module.exports = {\n        \"host\" : \"dev.db.com\",\n        \"user\" : \"devuser\",\n        \"pass\" : \"devpass\"\n    }\n\nWhen you create a configr instance (as shown below) the internal structure will be as follows:\n\n    {\n        \"general\" : {\n            \"app_name\" : \"test_app\",\n            \"hawtness\" : \"extreme\"\n        },\n\n        \"db\" : {\n            \"host\" : \"dev.db.com\", // Overriden\n            \"user\" : \"devuser\", // Overriden\n            \"pass\" : \"devpass\", // Overriden\n            \"db\"   : \"mydb\"\n        }\n    }\n\n## Usage\n\n    // Create a new configr instance for the provided environment. This is any arbitary name; \n    // dev, staging, prod, etc. (you can have multiple configr instances that are independant \n    // of one another).\n\n    var Configr = require(\"configr\");\n\n    var c = new Configr('/path/to/config/files');\n\t\n    // Load the configuration\n\n    // Access the configuration values\n    c.get().db // will return { \"host\" : \"127.0.0.1\", \"user\" : \"myuser\", \"pass\" : \"mypass\", \"db\" : \"mydb\"}\n    c.get().general.app_name // will return \"test_app\"\n\n    // Load the configuration for the dev environment\n    var c = new Configr('/path/to/config/files','dev');\n\n    // Access the configuration values\n    c.get().db // will return { \"host\" : \"dev.db.com\", \"user\" : \"devuser\", \"pass\" : \"devpass\", \"db\" : \"mydb\"}\n    c.get().general.app_name // will return \"test_app\"\n\n\n## Bugs\n\nSee <https://github.com/antz29/node-configr/issues>.\n","_attachments":{},"homepage":"http://github.com/antz29/node-configr","bugs":{"url":"http://github.com/antz29/node-configr/issues","email":"configr-bugs@antz29.com"}}