{"name":"configstore","version":"0.3.2","description":"Easily load and save config without having to think about where and how","keywords":["conf","config","configuration","settings","store","editable","yaml","yml"],"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"repository":{"type":"git","url":"https://github.com/yeoman/configstore"},"scripts":{"test":"mocha"},"engines":{"node":">=0.10.0"},"license":"BSD","dependencies":{"graceful-fs":"^3.0.1","js-yaml":"^3.1.0","mkdirp":"^0.5.0","object-assign":"^2.0.0","osenv":"^0.1.0","user-home":"^1.0.0","uuid":"^2.0.1","xdg-basedir":"^1.0.0"},"devDependencies":{"mocha":"*"},"files":["index.js"],"gitHead":"b82690fc401318ad18dcd7d151a0003a4898a314","bugs":{"url":"https://github.com/yeoman/configstore/issues"},"homepage":"https://github.com/yeoman/configstore","_id":"configstore@0.3.2","_shasum":"25e4c16c3768abf75c5a65bc61761f495055b459","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"addyosmani","email":"addyosmani@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"paulirish","email":"paul.irish@gmail.com"},{"name":"addyosmani","email":"addyosmani@gmail.com"},{"name":"passy","email":"phartig@rdrei.net"},{"name":"sboudrias","email":"admin@simonboudrias.com"},{"name":"eddiemonge","email":"eddie+npm@eddiemonge.com"}],"dist":{"shasum":"25e4c16c3768abf75c5a65bc61761f495055b459","tarball":"http://registry-npm.ywwl.com/configstore/download/configstore-0.3.2.tgz","integrity":"sha512-2aMMi3erDQwgL7BgnW0aIzILAikpVH4TVEz60F/naT+XsPPX6IaPEuF/zD28XSNFWO/mHQ9OVRxkvcSbq6EFdA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHFR3gwaA1TCOOepna+W1fg/P2/8kWhj2gqoVWPk+MnhAiEAvZ+y7wtKGQSVSY7LtZakFj4ByI6hmXp4vpqzNBeeVFw="}],"size":2136,"noattachment":false,"key":"/configstore/-/configstore-0.3.2.tgz"},"directories":{},"readme":"# configstore\n\n> Easily load and persist config without having to think about where and how\n\nThe config is stored in a JSON file located in `$XDG_CONFIG_HOME` or `~/.config`.\\\nExample: `~/.config/configstore/some-id.json`\n\n*If you need this for Electron, check out [`electron-store`](https://github.com/sindresorhus/electron-store) instead.*\\\n*And check out [`conf`](https://github.com/sindresorhus/conf) for a more modern version of `configstore`.*\n\n## Install\n\n```\n$ npm install configstore\n```\n\n## Usage\n\n```js\nimport Configstore from 'configstore';\n\nconst packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));\n\n// Create a Configstore instance.\nconst config = new Configstore(packageJson.name, {foo: 'bar'});\n\nconsole.log(config.get('foo'));\n//=> 'bar'\n\nconfig.set('awesome', true);\nconsole.log(config.get('awesome'));\n//=> true\n\n// Use dot-notation to access nested properties.\nconfig.set('bar.baz', true);\nconsole.log(config.get('bar'));\n//=> {baz: true}\n\nconfig.delete('awesome');\nconsole.log(config.get('awesome'));\n//=> undefined\n```\n\n## API\n\n### Configstore(packageName, defaults?, options?)\n\nReturns a new instance.\n\n#### packageName\n\nType: `string`\n\nName of your package.\n\n#### defaults\n\nType: `object`\n\nDefault config.\n\n#### options\n\nType: `object`\n\n##### globalConfigPath\n\nType: `boolean`\\\nDefault: `false`\n\nStore the config at `$CONFIG/package-name/config.json` instead of the default `$CONFIG/configstore/package-name.json`. This is not recommended as you might end up conflicting with other tools, rendering the \"without having to think\" idea moot.\n\n##### configPath\n\nType: `string`\\\nDefault: Automatic\n\n**Please don't use this option unless absolutely necessary and you know what you're doing.**\n\nSet the path of the config file. Overrides the `packageName` and `globalConfigPath` options.\n\n### Instance\n\nYou can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.\n\n### .set(key, value)\n\nSet an item.\n\n### .set(object)\n\nSet multiple items at once.\n\n### .get(key)\n\nGet an item.\n\n### .has(key)\n\nCheck if an item exists.\n\n### .delete(key)\n\nDelete an item.\n\n### .clear()\n\nDelete all items.\n\n### .size\n\nGet the item count.\n\n### .path\n\nGet the path to the config file. Can be used to show the user where the config file is located or even better open it for them.\n\n### .all\n\nGet all the config as an object or replace the current config with an object:\n\n```js\nconfig.all = {\n\thello: 'world'\n};\n```\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-configstore?utm_source=npm-configstore&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","publish_time":1420469562743,"_cnpm_publish_time":1420469562743,"dist-tags":{"latest":"8.0.0","legacy-v3":"3.1.5"}}