{
  "_args": [
    [
      {
        "raw": "nconf@^0.7.2",
        "scope": null,
        "escapedName": "nconf",
        "name": "nconf",
        "rawSpec": "^0.7.2",
        "spec": ">=0.7.2 <0.8.0",
        "type": "range"
      },
      "/build/npm-check-updates/pkg/npm-check-updates/usr/lib/node_modules/npm-check-updates/node_modules/snyk-config"
    ]
  ],
  "_from": "nconf@>=0.7.2 <0.8.0",
  "_id": "nconf@0.7.2",
  "_inCache": true,
  "_location": "/npm-check-updates/nconf",
  "_nodeVersion": "0.10.40",
  "_npmUser": {
    "name": "indexzero",
    "email": "charlie.robbins@gmail.com"
  },
  "_npmVersion": "2.6.1",
  "_phantomChildren": {},
  "_requested": {
    "raw": "nconf@^0.7.2",
    "scope": null,
    "escapedName": "nconf",
    "name": "nconf",
    "rawSpec": "^0.7.2",
    "spec": ">=0.7.2 <0.8.0",
    "type": "range"
  },
  "_requiredBy": [
    "/npm-check-updates/snyk-config"
  ],
  "_resolved": "https://registry.npmjs.org/nconf/-/nconf-0.7.2.tgz",
  "_shasum": "a05fdf22dc01c378dd5c4df27f2dc90b9aa8bb00",
  "_shrinkwrap": null,
  "_spec": "nconf@^0.7.2",
  "_where": "/build/npm-check-updates/pkg/npm-check-updates/usr/lib/node_modules/npm-check-updates/node_modules/snyk-config",
  "author": {
    "name": "Charlie Robbins",
    "email": "charlie.robbins@gmail.com"
  },
  "bugs": {
    "url": "https://github.com/flatiron/nconf/issues"
  },
  "dependencies": {
    "async": "~0.9.0",
    "ini": "1.x.x",
    "yargs": "~3.15.0"
  },
  "description": "Hierarchical node.js configuration with files, environment variables, command-line arguments, and atomic object merging.",
  "devDependencies": {
    "vows": "0.8.x"
  },
  "directories": {},
  "dist": {
    "shasum": "a05fdf22dc01c378dd5c4df27f2dc90b9aa8bb00",
    "tarball": "https://registry.npmjs.org/nconf/-/nconf-0.7.2.tgz"
  },
  "engines": {
    "node": ">= 0.4.0"
  },
  "gitHead": "c2b8b97778f45b22242b1d6cc9352528ca2384c4",
  "homepage": "https://github.com/flatiron/nconf#readme",
  "keywords": [
    "configuration",
    "key value store",
    "plugabble"
  ],
  "main": "./lib/nconf",
  "maintainers": [
    {
      "name": "indexzero",
      "email": "charlie.robbins@gmail.com"
    },
    {
      "name": "jcrugzz",
      "email": "jcrugzz@gmail.com"
    }
  ],
  "name": "nconf",
  "optionalDependencies": {},
  "readme": "# nconf\n\n[![Version npm](https://img.shields.io/npm/v/nconf.svg?style=flat-square)](https://www.npmjs.com/package/nconf)[![npm Downloads](https://img.shields.io/npm/dm/nconf.svg?style=flat-square)](https://www.npmjs.com/package/nconf)[![Build Status](https://img.shields.io/travis/indexzero/nconf/master.svg?style=flat-square)](https://travis-ci.org/indexzero/nconf)[![Dependencies](https://img.shields.io/david/indexzero/nconf.svg?style=flat-square)](https://david-dm.org/indexzero/nconf)\n\n[![NPM](https://nodei.co/npm/nconf.png?downloads=true&downloadRank=true)](https://nodei.co/npm/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 `:`. Let's 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 yargs. If `options` is supplied it is passed along to yargs.\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  // Note: A custom key must be supplied for hierarchy to work if multiple files are used.\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('supplied', { type: 'literal', store: { 'some': 'config' });\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 `yargs` into the configuration hierarchy. See the [yargs option docs](https://github.com/bcoe/yargs#optionskey-opt) for more on the option format.\n\n``` js\n  //\n  // Can optionally also be an object literal to pass to `yargs`.\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 all options\n  //\n  nconf.env({\n    separator: '__',\n    match: /^whatever_matches_this_will_be_whitelisted/\n    whitelist: ['database__host', 'only', 'load', 'these', 'values', 'if', 'whatever_doesnt_match_but_is_whitelisted_gets_loaded_too']\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. Note a custom key must be supplied as the first parameter for hierarchy to work if multiple files are used.\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\nIf the file does not exist at the provided path, the store will simply be empty.\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",
  "repository": {
    "type": "git",
    "url": "git+ssh://git@github.com/flatiron/nconf.git"
  },
  "scripts": {
    "test": "vows test/*-test.js test/**/*-test.js --spec"
  },
  "version": "0.7.2"
}
