{"_id":"konfig","_rev":"23-a966a32df7b2543a46b13ada2c346b5e","name":"konfig","description":"Config loader module. Automatic, environment specific and dynamic.","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"konfig","description":"Config management module. Automatic, environment specific and dynamic.","keywords":["config","configuration","environment","utilities","util"],"author":{"name":"Ali Davut","email":"adavut@gmail.com"},"repository":{"type":"git","url":"git://github.com/vngrs/konfig.git"},"version":"0.1.0","main":"lib/index.js","scripts":{"test":"mocha test/index.coffee"},"devDependencies":{"mocha":"~1.17.1","chai":"~1.8.1","grunt":"~0.4.1","grunt-contrib-coffee":"~0.7.0","coffee-script":"~1.6.3","matchdep":"~0.3.0"},"dependencies":{"underscore":"~1.5.2","js-yaml":"~3.0.1"},"bugs":{"url":"https://github.com/vngrs/konfig/issues"},"homepage":"https://github.com/vngrs/konfig","_id":"konfig@0.1.0","dist":{"shasum":"9aed262407562dbb805f6460059cfc092f8422d3","tarball":"https://registry.npmjs.org/konfig/-/konfig-0.1.0.tgz","integrity":"sha512-9el7Z+vxsrYo8BOmrPdXUBGczLBmQ7InO5wdCTsLD48RMVSAmxUN+EgChCQs5yWx+2XdPoehg1EAupEZwNGWGA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdq5VYZDI9FieYqr+jTfeUYKXyJhuCUxaeMtIqgcDoAQIgIL4RymZ5KYqi6M9ymfgP7l6erMQpzkQAOpUPcVwq6zo="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"vngrs","email":"npm@vngrs.com"},"maintainers":[{"name":"vngrs","email":"npm@vngrs.com"}],"directories":{}},"0.1.1":{"name":"konfig","description":"Config loader module. Automatic, environment specific and dynamic.","keywords":["config","configuration","environment","utilities","util"],"author":{"name":"Ali Davut","email":"adavut@gmail.com"},"repository":{"type":"git","url":"git://github.com/vngrs/konfig.git"},"version":"0.1.1","main":"lib/index.js","scripts":{"test":"mocha test/index.coffee"},"devDependencies":{"mocha":"~1.17.1","chai":"~1.8.1","grunt":"~0.4.1","grunt-contrib-coffee":"~0.7.0","coffee-script":"~1.6.3","matchdep":"~0.3.0"},"dependencies":{"underscore":"~1.5.2","js-yaml":"~3.0.1"},"license":"GPL-3.0","bugs":{"url":"https://github.com/vngrs/konfig/issues"},"homepage":"https://github.com/vngrs/konfig","_id":"konfig@0.1.1","dist":{"shasum":"5c092e96544267dcfbcca82e81d5925179fe9ab3","tarball":"https://registry.npmjs.org/konfig/-/konfig-0.1.1.tgz","integrity":"sha512-G8UKisqe7QfrFf/Ib2FgkMnaaJ7m5ru2U8W6oh/cqcH9tglpxg18LZhii5gqPiibtRyuuZKepIBBrIe3T1qTBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFn/uBzRC/zQ2ExNC4BInp7DHsvnqIVgrSpIx7sf5f5nAiEAiv2ssvSzCMnwsHJ8qlgc/0MGq9ecBdBVtiPmozrqems="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"vngrs","email":"npm@vngrs.com"},"maintainers":[{"name":"vngrs","email":"npm@vngrs.com"}]},"0.1.2":{"name":"konfig","description":"Config loader module. Automatic, environment specific and dynamic.","keywords":["config","configuration","environment","utilities","util"],"author":{"name":"Ali Davut","email":"adavut@gmail.com"},"repository":{"type":"git","url":"git://github.com/vngrs/konfig.git"},"version":"0.1.2","main":"lib/index.js","scripts":{"test":"mocha test/index.coffee"},"devDependencies":{"mocha":"~1.17.1","chai":"~1.8.1","grunt":"~0.4.1","grunt-contrib-coffee":"~0.7.0","coffee-script":"~1.6.3","matchdep":"~0.3.0"},"dependencies":{"underscore":"~1.5.2","js-yaml":"~3.0.1","cson":"~1.6.0"},"license":"GPL-3.0","bugs":{"url":"https://github.com/vngrs/konfig/issues"},"homepage":"https://github.com/vngrs/konfig","_id":"konfig@0.1.2","dist":{"shasum":"b64884e811b3f96a46255bafbc00fc952a8d4b55","tarball":"https://registry.npmjs.org/konfig/-/konfig-0.1.2.tgz","integrity":"sha512-NxqFcrhmjaT9x01cOuz+slxlMtDGWWLRQ/je3akA6473y+b2ntZasZOFoRWif9g7X+SGlsbt3JnBuan0kehBng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXF1SHsuXT38bLpfsvZ7esyMV7KGoRJaxczFHjl4JaIgIgXp5B2Zc4V95+YinwnMzg4HuN+oMYaG/S8G6wuTI7nXY="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"vngrs","email":"npm@vngrs.com"},"maintainers":[{"name":"vngrs","email":"npm@vngrs.com"}]},"0.1.3":{"name":"konfig","description":"Config loader module. Automatic, environment specific and dynamic.","keywords":["config","configuration","environment","utilities","util"],"author":{"name":"Ali Davut","email":"adavut@gmail.com"},"repository":{"type":"git","url":"git://github.com/vngrs/konfig.git"},"version":"0.1.3","main":"lib/index.js","scripts":{"test":"mocha test/index.coffee"},"devDependencies":{"mocha":"~1.17.1","chai":"~1.8.1","grunt":"~0.4.1","grunt-contrib-coffee":"~0.7.0","coffee-script":"~1.6.3","matchdep":"~0.3.0"},"dependencies":{"underscore":"~1.5.2","js-yaml":"~3.0.1","cson":"~1.6.0"},"license":"LGPL-3.0","bugs":{"url":"https://github.com/vngrs/konfig/issues"},"homepage":"https://github.com/vngrs/konfig","_id":"konfig@0.1.3","dist":{"shasum":"53677564378e542902b010c89aa0fc650a9c431c","tarball":"https://registry.npmjs.org/konfig/-/konfig-0.1.3.tgz","integrity":"sha512-eFZ5EiBtSkpGm/NrFrPgRZPjN56MRFiufMlYFiNwmU4whapHPzNXT8FSSOKihPRia+GT9asoCLYFIDu/aCVVTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD06HNqXGO0qPL2vUIyKTqYpmYlQom8usiYccK/HlSI8AIgWqQjq9x3bLb/AbSnzAT6AgYTGMnu9caUsrCAvlPGM+4="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"vngrs","email":"npm@vngrs.com"},"maintainers":[{"name":"vngrs","email":"npm@vngrs.com"}]},"0.2.0":{"name":"konfig","description":"Config loader module. Automatic, environment specific and dynamic.","keywords":["config","configuration","environment","utilities","util"],"author":{"name":"Ali Davut","email":"adavut@gmail.com"},"repository":{"type":"git","url":"git://github.com/vngrs/konfig.git"},"version":"0.2.0","main":"lib/index.js","scripts":{"test":"mocha test/index.coffee"},"devDependencies":{"mocha":"~1.17.1","chai":"~1.8.1","grunt":"~0.4.1","grunt-contrib-coffee":"~0.7.0","coffee-script":"~1.6.3","matchdep":"~0.3.0"},"dependencies":{"js-yaml":"~3.0.1","cson":"~1.6.0","lazy.js":"~0.3.2"},"license":"LGPL-3.0","bugs":{"url":"https://github.com/vngrs/konfig/issues"},"homepage":"https://github.com/vngrs/konfig","_id":"konfig@0.2.0","dist":{"shasum":"7b27eb14fb6d68a4cc430b04951bbcc7692837c2","tarball":"https://registry.npmjs.org/konfig/-/konfig-0.2.0.tgz","integrity":"sha512-/K2cbslaUMGcOwHSsHTUO0OrpGWAOEBgf0T8BxhGxWCN11YjfSU/CTowSzX0x+QZx7iHZoMPcNpjfnvf071FQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPWeNoxs+OHU8CRheW2sihhWZdz8fDKB2C51Z63/DpfgIhAOE2LCQ7YPSPtRvy7pq1kjsCNXOZkvo6VuG9BrRwJC7r"}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"vngrs","email":"npm@vngrs.com"},"maintainers":[{"name":"vngrs","email":"npm@vngrs.com"}]},"0.2.1":{"name":"konfig","description":"Config loader module. Automatic, environment specific and dynamic.","keywords":["config","configuration","environment","utilities","util"],"author":{"name":"Ali Davut","email":"adavut@gmail.com"},"repository":{"type":"git","url":"git://github.com/vngrs/konfig.git"},"version":"0.2.1","main":"lib/index.js","scripts":{"test":"mocha test/index.coffee"},"devDependencies":{"mocha":"~1.17.1","chai":"~1.8.1","grunt":"~0.4.1","grunt-contrib-coffee":"~0.7.0","coffee-script":"~1.6.3","matchdep":"~0.3.0"},"dependencies":{"cson":"~2.0.0","js-yaml":"~3.2.7","lazy.js":"~0.4.0"},"license":"LGPL-3.0","gitHead":"5a1dba57797f177ad9406fd0d1fa6910abd22c11","bugs":{"url":"https://github.com/vngrs/konfig/issues"},"homepage":"https://github.com/vngrs/konfig","_id":"konfig@0.2.1","_shasum":"4be83ebb859207dbdad8d0e6eeb6004245de3cd8","_from":".","_npmVersion":"2.7.0","_nodeVersion":"0.10.32","_npmUser":{"name":"vngrs","email":"npm@vngrs.com"},"maintainers":[{"name":"vngrs","email":"npm@vngrs.com"}],"dist":{"shasum":"4be83ebb859207dbdad8d0e6eeb6004245de3cd8","tarball":"https://registry.npmjs.org/konfig/-/konfig-0.2.1.tgz","integrity":"sha512-OjftVbx//zs2HvLgE1B2h/qxWgN1DjKNA7PnerBVoS1xmfNZ/4QV/0k6TbOBIVh6uBGCkmlc4q5UZqetzm9ffg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhGkqUjByZwROkgCGGMf9Vap11MnSULsd4XQFwcBsnVgIgSmR/XxRe8WbR5s6RhT6DwB1+pUNY4c8a6H8wLTGxMro="}]}}},"readme":"KONFIG\n======\nKonfig is a **config loader** module which allows you to load **json**, **cson** and **yaml** files automatically **by environment** in node.js applications. You can also define **dynamic values** which can be used especially for dynamic environment variables on Heroku like services.\n\n## Installation\nFirst intall module from npm :\n```bash\n$ npm install konfig\n```\nCreate a folder named ```config``` under the root directory of the project. Then load Konfig in your application file :\n```javascript\nvar config = require('konfig')()\n\n// Don't forget parentheses to call the function\n```\n\nWe recommend you to define config variable as global :\n```javascript\nglobal.config = require('konfig')()\n```\n\nYou can also use different folder name except ```config``` by passing path variable while loading Konfig :\n```javascript\nglobal.config = require('konfig')({ path: './another_directory' })\n```\n\n## Usage\n\nLet's create an example config file under ```config``` folder named ```app.json``` or ```app.yml```\n\n```json\n{\n    \"default\": {\n        \"port\": 3000,\n        \"cache_assets\": true,\n        \"secret_key\": \"7EHDWHD9W9UW9FBFB949394BWYFG8WE78F\"\n    },\n\n    \"development\": {\n        \"cache_assets\": false\n    },\n\n    \"test\": {\n        \"port\": 3001\n    },\n\n    \"staging\": {\n        \"port\": #{process.env.PORT},\n        \"secret_key\": \"3F8RRJR30UHERGUH8UERHGIUERHG3987GH8\"\n    },\n\n    \"production\": {\n        \"port\": #{process.env.PORT},\n        \"secret_key\": \"3F8RRJR30UHERGUH8UERHGIUERHG3987GH8\"\n    }\n}\n```\n\nIf you use yaml format the config file will be like this :\n\n```yaml\ndefault:\n    port: 3000\n    cache_assets: true\n    secret_key: 7EHDWHD9W9UW9FBFB949394BWYFG8WE78F\n\ndevelopment:\n    cache_assets: false\n\ntest:\n    port: 3001\n\nproduction: &production\n    port: #{process.env.PORT}\n    secret_key: 3F8RRJR30UHERGUH8UERHGIUERHG3987GH8\n\n# aliases must be defined before you include!\nstaging:\n    <<: *production\n```\n\nAfter creating config files, let's try it by using node interpreter. But first ensure that the module is installed ```npm install konfig``` and open node interpreter in the root directory of the project :\n\n```bash\n$ node\n```\nThen load the module\n```javascript\n> var config = require('konfig')()\n```\nLet's try to get port and secret key values, remember that the **default environment** will be **development** and the config object structure will be ```config.[filename].[config_key]...```\n```javascript\n> config.app.port\n3000\n> config.app.secret_key\n'7EHDWHD9W9UW9FBFB949394BWYFG8WE78F'\n```\nQuit interpreter, and let's open the interpreter with ```staging``` environment with port 4567. If you look at the config file you will see the staging port is **dynamic value**. Konfig enables you to use node variables in your config file by using **#{}** signs.\n```bash\n$ NODE_ENV=staging PORT=4567 node\n> var config = require('konfig')()\n```\nNow, we will get some config values:\n```javascript\n> config.app.port\n4567\n> config.app.secret_key\n'3F8RRJR30UHERGUH8UERHGIUERHG3987GH8'\n```\n\nNotice that **default values** copies itself to the config if there is no key in the environment config with the same name.\n\n## License\nKonfig is released under GNU Lesser General Public License v3 (or higher) published by Free Software Foundation. See http://www.gnu.org/licenses/lgpl-3.0.html for more details.\n","maintainers":[{"name":"vngrs","email":"npm@vngrs.com"}],"time":{"modified":"2022-06-19T09:44:53.181Z","created":"2014-02-03T10:56:43.423Z","0.1.0":"2014-02-03T10:56:43.423Z","0.1.1":"2014-02-06T08:16:48.520Z","0.1.2":"2014-06-02T09:03:22.965Z","0.1.3":"2014-06-10T12:40:41.644Z","0.2.0":"2014-07-16T18:52:19.138Z","0.2.1":"2015-03-09T12:48:22.634Z"},"readmeFilename":"README.md","users":{"dusandz":true},"homepage":"https://github.com/vngrs/konfig","keywords":["config","configuration","environment","utilities","util"],"repository":{"type":"git","url":"git://github.com/vngrs/konfig.git"},"author":{"name":"Ali Davut","email":"adavut@gmail.com"},"bugs":{"url":"https://github.com/vngrs/konfig/issues"},"license":"LGPL-3.0"}