summaryrefslogtreecommitdiff
path: root/node_modules/forever/node_modules/nconf/package.json
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/forever/node_modules/nconf/package.json')
-rw-r--r--node_modules/forever/node_modules/nconf/package.json51
1 files changed, 51 insertions, 0 deletions
diff --git a/node_modules/forever/node_modules/nconf/package.json b/node_modules/forever/node_modules/nconf/package.json
new file mode 100644
index 0000000..0e875e1
--- /dev/null
+++ b/node_modules/forever/node_modules/nconf/package.json
@@ -0,0 +1,51 @@
+{
+ "name": "nconf",
+ "description": "Hierarchical node.js configuration with files, environment variables, command-line arguments, and atomic object merging.",
+ "version": "0.6.7",
+ "author": {
+ "name": "Nodejitsu Inc.",
+ "email": "info@nodejitsu.com"
+ },
+ "maintainers": [
+ {
+ "name": "indexzero",
+ "email": "charlie@nodejitsu.com"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/flatiron/nconf.git"
+ },
+ "keywords": [
+ "configuration",
+ "key value store",
+ "plugabble"
+ ],
+ "dependencies": {
+ "async": "0.1.x",
+ "ini": "1.x.x",
+ "optimist": "0.3.x",
+ "pkginfo": "0.2.x"
+ },
+ "devDependencies": {
+ "vows": "0.6.x"
+ },
+ "main": "./lib/nconf",
+ "scripts": {
+ "test": "vows test/*-test.js test/**/*-test.js --spec"
+ },
+ "engines": {
+ "node": ">= 0.4.0"
+ },
+ "readme": "# nconf [![Build Status](https://secure.travis-ci.org/flatiron/nconf.png)](http://travis-ci.org/flatiron/nconf)\n\nHierarchical node.js configuration with files, environment variables, command-line arguments, and atomic object merging.\n\n## Example\nUsing nconf is easy; it is designed to be a simple key-value store with support for both local and remote storage. Keys are namespaced and delimited by `:`. Lets dive right into sample usage:\n\n``` js\n var fs = require('fs'),\n nconf = require('nconf');\n\n //\n // Setup nconf to use (in-order):\n // 1. Command-line arguments\n // 2. Environment variables\n // 3. A file located at 'path/to/config.json'\n //\n nconf.argv()\n .env()\n .file({ file: 'path/to/config.json' });\n\n //\n // Set a few variables on `nconf`.\n //\n nconf.set('database:host', '127.0.0.1');\n nconf.set('database:port', 5984);\n\n //\n // Get the entire database object from nconf. This will output\n // { host: '127.0.0.1', port: 5984 }\n //\n console.log('foo: ' + nconf.get('foo'));\n console.log('NODE_ENV: ' + nconf.get('NODE_ENV'));\n console.log('database: ' + nconf.get('database'));\n\n //\n // Save the configuration object to disk\n //\n nconf.save(function (err) {\n fs.readFile('path/to/your/config.json', function (err, data) {\n console.dir(JSON.parse(data.toString()))\n });\n });\n```\n\nIf you run the above script:\n\n``` bash\n $ NODE_ENV=production sample.js --foo bar\n```\n\nThe output will be:\n\n```\n foo: bar\n NODE_ENV: production\n database: { host: '127.0.0.1', port: 5984 }\n```\n\n## Hierarchical configuration\n\nConfiguration management can get complicated very quickly for even trivial applications running in production. `nconf` addresses this problem by enabling you to setup a hierarchy for different sources of configuration with no defaults. **The order in which you attach these configuration sources determines their priority in the hierarchy.** Lets take a look at the options available to you\n\n 1. **nconf.argv(options)** Loads `process.argv` using optimist. If `options` is supplied it is passed along to optimist.\n 2. **nconf.env(options)** Loads `process.env` into the hierarchy.\n 3. **nconf.file(options)** Loads the configuration data at options.file into the hierarchy.\n 4. **nconf.defaults(options)** Loads the data in options.store into the hierarchy.\n 5. **nconf.overrides(options)** Loads the data in options.store into the hierarchy.\n\nA sane default for this could be:\n\n``` js\n var nconf = require('nconf');\n\n //\n // 1. any overrides\n //\n nconf.overrides({\n 'always': 'be this value'\n });\n\n //\n // 2. `process.env`\n // 3. `process.argv`\n //\n nconf.env().argv();\n\n //\n // 4. Values in `config.json`\n //\n nconf.file('/path/to/config.json');\n\n //\n // Or with a custom name\n //\n nconf.file('custom', '/path/to/config.json');\n\n //\n // Or searching from a base directory.\n // Note: `name` is optional.\n //\n nconf.file(name, {\n file: 'config.json',\n dir: 'search/from/here',\n search: true\n });\n\n //\n // 5. Any default values\n //\n nconf.defaults({\n 'if nothing else': 'use this value'\n });\n```\n\n## API Documentation\n\nThe top-level of `nconf` is an instance of the `nconf.Provider` abstracts this all for you into a simple API.\n\n### nconf.add(name, options)\nAdds a new store with the specified `name` and `options`. If `options.type` is not set, then `name` will be used instead:\n\n``` js\n nconf.add('user', { type: 'file', file: '/path/to/userconf.json' });\n nconf.add('global', { type: 'file', file: '/path/to/globalconf.json' });\n```\n\n### nconf.use(name, options)\nSimilar to `nconf.add`, except that it can replace an existing store if new options are provided\n\n``` js\n //\n // Load a file store onto nconf with the specified settings\n //\n nconf.use('file', { file: '/path/to/some/config-file.json' });\n\n //\n // Replace the file store with new settings\n //\n nconf.use('file', { file: 'path/to/a-new/config-file.json' });\n```\n\n### nconf.remove(name)\nRemoves the store with the specified `name.` The configuration stored at that level will no longer be used for lookup(s).\n\n``` js\n nconf.remove('file');\n```\n\n## Storage Engines\n\n### Memory\nA simple in-memory storage engine that stores a nested JSON representation of the configuration. To use this engine, just call `.use()` with the appropriate arguments. All calls to `.get()`, `.set()`, `.clear()`, `.reset()` methods are synchronous since we are only dealing with an in-memory object.\n\n``` js\n nconf.use('memory');\n```\n\n### Argv\nResponsible for loading the values parsed from `process.argv` by `optimist` into the configuration hierarchy. See the [optimist option docs](https://github.com/substack/node-optimist/#optionskey-opt) for more on the option format.\n\n``` js\n //\n // Can optionally also be an object literal to pass to `optimist`.\n //\n nconf.argv({\n \"x\": {\n alias: 'example',\n describe: 'Example description for usage generation',\n demand: true,\n default: 'some-value'\n }\n });\n```\n\n### Env\nResponsible for loading the values parsed from `process.env` into the configuration hierarchy.\n\n``` js\n //\n // Can optionally also be an Array of values to limit process.env to.\n //\n nconf.env(['only', 'load', 'these', 'values', 'from', 'process.env']);\n\n //\n // Can also specify a separator for nested keys (instead of the default ':')\n //\n nconf.env('__');\n // Get the value of the env variable 'database__host'\n var dbHost = nconf.get('database:host');\n\n //\n // Or use both options\n //\n nconf.env({\n separator: '__',\n whitelist: ['database__host', 'only', 'load', 'these', 'values']\n });\n var dbHost = nconf.get('database:host');\n```\n\n### Literal\nLoads a given object literal into the configuration hierarchy. Both `nconf.defaults()` and `nconf.overrides()` use the Literal store.\n\n``` js\n nconf.defaults({\n 'some': 'default value'\n });\n```\n\n### File\nBased on the Memory store, but provides additional methods `.save()` and `.load()` which allow you to read your configuration to and from file. As with the Memory store, all method calls are synchronous with the exception of `.save()` and `.load()` which take callback functions. It is important to note that setting keys in the File engine will not be persisted to disk until a call to `.save()` is made.\n\n``` js\n nconf.file('path/to/your/config.json');\n // add multiple files, hierarchically. notice the unique key for each file\n nconf.file('user', 'path/to/your/user.json');\n nconf.file('global', 'path/to/your/global.json');\n```\n\nThe file store is also extensible for multiple file formats, defaulting to `JSON`. To use a custom format, simply pass a format object to the `.use()` method. This object must have `.parse()` and `.stringify()` methods just like the native `JSON` object.\n\n### Redis\nThere is a separate Redis-based store available through [nconf-redis][0]. To install and use this store simply:\n\n``` bash\n $ npm install nconf\n $ npm install nconf-redis\n```\n\nOnce installing both `nconf` and `nconf-redis`, you must require both modules to use the Redis store:\n\n``` js\n var nconf = require('nconf');\n\n //\n // Requiring `nconf-redis` will extend the `nconf`\n // module.\n //\n require('nconf-redis');\n\n nconf.use('redis', { host: 'localhost', port: 6379, ttl: 60 * 60 * 1000 });\n```\n\n## Installation\n\n### Installing npm (node package manager)\n```\n curl http://npmjs.org/install.sh | sh\n```\n\n### Installing nconf\n```\n [sudo] npm install nconf\n```\n\n## More Documentation\nThere is more documentation available through docco. I haven't gotten around to making a gh-pages branch so in the meantime if you clone the repository you can view the docs:\n\n```\n open docs/nconf.html\n```\n\n## Run Tests\nTests are written in vows and give complete coverage of all APIs and storage engines.\n\n``` bash\n $ npm test\n```\n\n#### Author: [Charlie Robbins](http://nodejitsu.com)\n#### License: MIT\n\n[0]: http://github.com/indexzero/nconf-redis\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/flatiron/nconf/issues"
+ },
+ "_id": "nconf@0.6.7",
+ "dist": {
+ "shasum": "30131fa2e961580f02dc7c89b1a58626eb4f7340"
+ },
+ "_from": "nconf@0.6.7",
+ "_resolved": "https://registry.npmjs.org/nconf/-/nconf-0.6.7.tgz"
+}