{"_id":"universal-config","_rev":"7-99a7b5c83c60b73d720711d90c2a335b","name":"universal-config","description":"Configuration for your universal Javascript application","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.0":{"name":"universal-config","version":"0.0.0","description":"Hierarchical configuration with files and environment variables for your universal app","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/naoufal/universal-config"},"keywords":["configuration","config","conf","env","environment variables","files","universal","node","browser","key","value","store","broswerify","webpack"],"author":{"name":"Naoufal Kadhom","email":"naoufalkadhom@gmail.com","url":"https://github.com/naoufal"},"license":"ISC","bugs":{"url":"https://github.com/naoufal/universal-config/issues"},"homepage":"https://github.com/naoufal/universal-config","_id":"universal-config@0.0.0","_shasum":"3f77f47170ff0d0c394aab3c341e8a782c8db346","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.10.28","_npmUser":{"name":"naoufal","email":"hi@naoufal.com"},"maintainers":[{"name":"naoufal","email":"hi@naoufal.com"}],"dist":{"shasum":"3f77f47170ff0d0c394aab3c341e8a782c8db346","tarball":"https://registry.npmjs.org/universal-config/-/universal-config-0.0.0.tgz","integrity":"sha512-QMNsBIkLDEHuz8oRmdTN2sF7SYo6S9xdoc8aEkt3tkQaK76Lzk9gS+BwztmsFyFeE8/mQfp4GAwUXdB1+58G9w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDx2gR5MzAU4XmvX/YSe9UfkjQDmKB/AslfCRs4MHeGkAIgCQjlkob2JMgJnZS6c/sFpW3XkUhLJ1kq9fS31pa6F7Y="}]}},"0.1.0":{"name":"universal-config","version":"0.1.0","description":"Configuration for your universal Javascript application","main":"lib/index.js","scripts":{"build":"babel --optional runtime src --out-dir lib","build:test":"npm run build:test:browserify && npm run build:test:webpack","build:test:browserify":"browserify -e test/browserify.js -o test/browserify-test.js -t ./test/support/browserify-transform-stub.js","build:test:webpack":"webpack --config webpack.config.test.js","copy:lib":"sh ./scripts/copy-lib.sh","dev":"babel --optional runtime src --watch --out-dir lib && npm run copy:lib","test":"npm run build && NODE_ENV=test ./node_modules/.bin/testem --port 8080","test:ci":"npm run build && NODE_ENV=test ./node_modules/.bin/testem ci --port 8080"},"repository":{"type":"git","url":"git+https://github.com/naoufal/universal-config.git"},"keywords":["configuration","config","conf","env","environment variables","files","universal","node","browser","key","value","store","broswerify","webpack"],"author":{"name":"Naoufal Kadhom","email":"naoufalkadhom@gmail.com","url":"https://github.com/naoufal"},"license":"ISC","bugs":{"url":"https://github.com/naoufal/universal-config/issues"},"homepage":"https://github.com/naoufal/universal-config","dependencies":{"envify":"3.4.0","through":"2.3.8"},"devDependencies":{"babel":"5.8.21","babel-core":"5.8.22","babel-loader":"5.3.2","babel-runtime":"5.8.20","browserify":"11.0.1","chai":"2.0.0","mocha":"2.2.5","mockery":"1.4.0","saucie":"0.1.6","testem":"0.9.4","webpack":"1.11.0"},"browser":{"../../../config/server":false,"../../../config/local/server":false},"browserify":{"transform":["envify"]},"gitHead":"6383e3f8bd7c784b39ea855bf0675ba918ca4d10","_id":"universal-config@0.1.0","_shasum":"e5645b2a7e95a373ec0e7b76bc3c9c1d966ddd27","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.2","_npmUser":{"name":"naoufal","email":"naoufalkadhom@gmail.com"},"maintainers":[{"name":"naoufal","email":"hi@naoufal.com"}],"dist":{"shasum":"e5645b2a7e95a373ec0e7b76bc3c9c1d966ddd27","tarball":"https://registry.npmjs.org/universal-config/-/universal-config-0.1.0.tgz","integrity":"sha512-0huXoM+/TwHVmLOxBLa4Noe1KVS+ALxjqlCvdy87qV1rFQ0GV7iuiOzX9hfzLVylM5dZ3Mr3TP0MGFdnv3KWMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMfWSRgjWpA+Jtd7SIvOZgJkpGy6xIOWa12AVBfB2zAgIgKAz/zkd++kcQes3Uwlsmgo/zjkVk/lt1i5Zwx84A1sk="}]}},"0.2.0":{"name":"universal-config","version":"0.2.0","description":"Configuration for your universal Javascript application","main":"lib/index.js","scripts":{"build":"babel --optional runtime src --out-dir lib","build:test":"npm run build:test:browserify && npm run build:test:webpack","build:test:browserify":"browserify -e test/browserify.js -o test/browserify-test.js -t ./test/support/browserify-transform-stub.js","build:test:webpack":"webpack --config webpack.config.test.js","copy:lib":"sh ./scripts/copy-lib.sh","dev":"babel --optional runtime src --watch --out-dir lib && npm run copy:lib","test":"npm run build && NODE_ENV=test ./node_modules/.bin/testem --port 8080","test:ci":"npm run build && NODE_ENV=test ./node_modules/.bin/testem ci --port 8080"},"repository":{"type":"git","url":"git+https://github.com/naoufal/universal-config.git"},"keywords":["configuration","config","conf","env","environment variables","files","universal","node","browser","key","value","store","broswerify","webpack"],"author":{"name":"Naoufal Kadhom","email":"naoufalkadhom@gmail.com","url":"https://github.com/naoufal"},"license":"ISC","bugs":{"url":"https://github.com/naoufal/universal-config/issues"},"homepage":"https://github.com/naoufal/universal-config","dependencies":{"envify":"3.4.0","through":"2.3.8"},"devDependencies":{"babel":"5.8.21","babel-core":"5.8.22","babel-loader":"5.3.2","babel-runtime":"5.8.20","browserify":"11.0.1","chai":"2.0.0","mocha":"2.2.5","mockery":"1.4.0","saucie":"0.1.6","testem":"0.9.4","webpack":"1.11.0"},"browser":{"../../../config/server":false,"../../../config/local/server":false},"browserify":{"transform":["envify"]},"gitHead":"312e21fbdd6c085166c41ef24f01667da6b2299e","_id":"universal-config@0.2.0","_shasum":"6b311953652bc53daba6ed062b120e679c7add1e","_from":".","_npmVersion":"3.7.1","_nodeVersion":"4.2.4","_npmUser":{"name":"naoufal","email":"hi@naoufal.com"},"dist":{"shasum":"6b311953652bc53daba6ed062b120e679c7add1e","tarball":"https://registry.npmjs.org/universal-config/-/universal-config-0.2.0.tgz","integrity":"sha512-qmgphN3DgQ+IxO4a3J6iyJSwy00rCJoI+vH4RVtGMIlF/Lz4VzkMoNXRyRlXBxCoKrDbgsnP/jJfGesX3YpRuA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAkPG2H8WZrO8G4vu3yytXeh0Vmy+LYzvK88VFczQ2l6AiEArTSPkjgIB+GreQoEpGb7/PeoCyXozWlPDMmDkOELKCI="}]},"maintainers":[{"name":"naoufal","email":"hi@naoufal.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/universal-config-0.2.0.tgz_1459888235144_0.2986828563734889"}},"0.3.0":{"name":"universal-config","version":"0.3.0","description":"Configuration for your universal Javascript application","main":"lib/index.js","scripts":{"build":"babel --optional runtime src --out-dir lib","build:test":"npm run build:test:browserify && npm run build:test:webpack","build:test:browserify":"browserify -e test/browserify.js -o test/browserify-test.js -t ./test/support/browserify-transform-stub.js","build:test:webpack":"webpack --config webpack.config.test.js","copy:lib":"sh ./scripts/copy-lib.sh","dev":"babel --optional runtime src --watch --out-dir lib && npm run copy:lib","test":"npm run build && NODE_ENV=test ./node_modules/.bin/testem --port 8080","test:ci":"npm run build && NODE_ENV=test ./node_modules/.bin/testem ci --port 8080"},"repository":{"type":"git","url":"git+https://github.com/naoufal/universal-config.git"},"keywords":["configuration","config","conf","env","environment variables","files","universal","node","browser","key","value","store","broswerify","webpack"],"author":{"name":"Naoufal Kadhom","email":"naoufalkadhom@gmail.com","url":"https://github.com/naoufal"},"license":"ISC","bugs":{"url":"https://github.com/naoufal/universal-config/issues"},"homepage":"https://github.com/naoufal/universal-config","dependencies":{"envify":"3.4.0","through":"2.3.8"},"devDependencies":{"babel":"5.8.21","babel-core":"5.8.22","babel-loader":"5.3.2","babel-runtime":"5.8.20","browserify":"11.0.1","chai":"2.0.0","mocha":"2.2.5","mockery":"1.4.0","saucie":"0.1.6","testem":"0.9.4","webpack":"1.11.0"},"browser":{"../../../config/server":false,"../../../config/local/server":false},"browserify":{"transform":["envify"]},"gitHead":"438a297fee55f53881cc3632a15e0f979ef909eb","_id":"universal-config@0.3.0","_shasum":"c69547f53c355b62578e06ae6845c65e55f60a61","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"naoufal","email":"hi@naoufal.com"},"dist":{"shasum":"c69547f53c355b62578e06ae6845c65e55f60a61","tarball":"https://registry.npmjs.org/universal-config/-/universal-config-0.3.0.tgz","integrity":"sha512-VYqqcXAllt5tXv838FLjIvpvzES3TPtpgMsc6fh/g1nt7HzRU6fXntVCCw4dnYsU1VjEkk53ankYIlfJoWqlbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2N15+TzAc3E1xdXU9bOvhj3VE092weFaEdPk9R61yEgIhAO1drzD9/UQb0CZNWTonIvUEyhwhranYvO/OAM/8+PBs"}]},"maintainers":[{"name":"naoufal","email":"hi@naoufal.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/universal-config-0.3.0.tgz_1479226262544_0.9893026624340564"}}},"readme":"Universal Config\n==================\nConfiguration for your [Universal JavaScript](https://medium.com/@mjackson/universal-javascript-4761051b7ae9) apps.\n\n[![NPM Version](https://img.shields.io/npm/v/universal-config.svg?style=flat-square)](https://www.npmjs.org/package/universal-config)[![npm downloads](https://img.shields.io/npm/dm/universal-config.svg?style=flat-square)](https://www.npmjs.com/package/universal-config)[![Travis](https://img.shields.io/travis/naoufal/universal-config.svg?style=flat-square)](https://travis-ci.org/naoufal/universal-config)[![Climate](https://img.shields.io/codeclimate/github/naoufal/universal-config.svg?style=flat-square)](https://codeclimate.com/github/naoufal/universal-config)\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/universal-config.svg)](https://saucelabs.com/u/universal-config)\n\n## Install\n\n```shell\nnpm i --save universal-config\n```\n\n## Usage\n### Setup\nCreate a config folder at the root of your project.\n```\nmkdir config\n```\n\nWithin the `config` folder, create a `server.js` file that exports an Object containing your private config.\n\n__`config/server.js`__\n\n```js\nexport default {\n  AWS: {\n    accessKey: process.env.AWS_ACCESS_KEY,\n    secretKey: process.env.AWS_SECRET_KEY\n  },\n  MAILCHIMP: {\n    username: process.env.MAILCHIMP_USERNAME,\n    password: process.env.MAILCHIMP_PASSWORD\n  }\n}\n```\nOnce that's done, create a `client.js` file that does the same but for your publicly accessible config.\n\n__`config/client.js`__\n\n```js\nexport default {\n  API_URL: process.env.API_URL || \"//api.herokuapp.com\",\n  FACEBOOK_APP_ID: 123456789012345,\n  NODE_ENV: process.env.NODE_ENV || \"development\",\n  SENTRY_CLIENT_KEY: process.env.SENTRY_CLIENT_KEY || \"a1b2c3d4e5f6g7h8i9j0\"\n}\n```\n\n### Server side\nUsing Universal Config on the server is as simple as importing the module.\n\n```js\n// Server JavaScript\n\nimport config from \"universal-config\";\n\nconfig.get(\"AWS:accessKey\");  // Outputs your AWS_SECRET_KEY\n```\n\n### Client side\nWhether you're on team Browserify or Webpack, Universal Config has you covered!\n\n#### Browserify\nSee the [Browserify example](https://github.com/naoufal/universal-config/tree/master/examples/browserify) for more info.\n\n#### Webpack\nSee the [Webpack example](https://github.com/naoufal/universal-config/tree/master/examples/webpack) for more info.\n\n---\n\nOnce you're setup, you'll be able to retrive your client config.  It's worth noting that your server config won't be accessible on the client.\n\n```js\n// Client JavaScript\n\nimport config from \"universal-config\";\n\nconfig.get(\"AWS:accessKey\");   // undefined\nconfig.get(\"FACEBOOK_APP_ID\"); // Outputs your FACEBOOK_APP_ID\n```\n\n### Local Development\nIn development, you may want to environment variables in a file instead of your `.bash_profile`.\n\nIf you want to use this approach, you can override any server or client variable by creating a `dev.js` file in your `config` directory.  You'll want to add this file to your `.gitignore`.\n\nFor testing production locally, you may also specify a `prod.js` in the config directory. It will be imported when NODE_ENV is set to 'production'.\n\n__NOTE:__ _The variables in these files will be exposed both on the client and the server, but this shouldn't be a problem since you should only be using this locally._\n\n## Methods\n\n### get(key)\nRetrieves a key from your config.\n\n__Arguments__\n- `key` - The variable you want to retrieve from your configuration.\n\n__Examples__\n```js\nimport config from \"universal-config\";\n\nconst FACEBOOK_APP_ID = config.get(\"FACEBOOK_APP_ID\");\n```\n---\n\n### set(key, value)\nOverwrites a variable in your configuration or sets a new one if the variable doesn't exist.\n\n__Arguments__\n- `key` - The name of the variable you want to overwrite or sets it on your config instance.\n- `value` - The value you want to store.\n\n__Examples__\n```js\nimport config from \"universal-config\";\n\nconfig.set(\"FOO\", \"bar\");\nconsole.log(config.get(\"FOO\")); // bar\n```\n\n## License\nCopyright (c) 2015, [Naoufal Kadhom](http://naoufal.com)\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","maintainers":[{"name":"naoufal","email":"hi@naoufal.com"}],"time":{"modified":"2022-06-28T04:57:59.569Z","created":"2015-08-17T13:32:43.174Z","0.0.0":"2015-08-17T13:32:43.174Z","0.1.0":"2015-11-10T02:57:12.417Z","0.2.0":"2016-04-05T20:30:37.521Z","0.3.0":"2016-11-15T16:11:04.660Z"},"homepage":"https://github.com/naoufal/universal-config","keywords":["configuration","config","conf","env","environment variables","files","universal","node","browser","key","value","store","broswerify","webpack"],"repository":{"type":"git","url":"git+https://github.com/naoufal/universal-config.git"},"author":{"name":"Naoufal Kadhom","email":"naoufalkadhom@gmail.com","url":"https://github.com/naoufal"},"bugs":{"url":"https://github.com/naoufal/universal-config/issues"},"license":"ISC","readmeFilename":"README.md","users":{"davidjsalazarmoreno":true}}