{"name":"configstore","version":"7.0.0","description":"Easily load and save config without having to think about where and how","license":"BSD-2-Clause","repository":{"type":"git","url":"git+https://github.com/yeoman/configstore.git"},"funding":"https://github.com/yeoman/configstore?sponsor=1","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["config","store","storage","configuration","settings","preferences","json","data","persist","persistent","save"],"dependencies":{"atomically":"^2.0.3","dot-prop":"^9.0.0","graceful-fs":"^4.2.11","xdg-basedir":"^5.1.0"},"devDependencies":{"ava":"^6.1.3","xo":"^0.58.0"},"ava":{"serial":true},"_id":"configstore@7.0.0","gitHead":"4edf4371aa5d48a7d2446cd6919a3a29fc568b78","bugs":{"url":"https://github.com/yeoman/configstore/issues"},"homepage":"https://github.com/yeoman/configstore#readme","_nodeVersion":"18.20.2","_npmVersion":"10.6.0","dist":{"integrity":"sha512-yk7/5PN5im4qwz0WFZW3PXnzHgPu9mX29Y8uZ3aefe2lBPC1FYttWZRcaW9fKkT0pBCJyuQ2HfbmPVaODi9jcQ==","shasum":"4461561fc51cb40e5ee1161230bc0337e069cc6b","tarball":"http://registry-npm.ywwl.com/configstore/download/configstore-7.0.0.tgz","fileCount":4,"unpackedSize":7277,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGHsp7e0J+YBgJGER/gAVPUY+arZ/esgH5mqvP9IRc84AiBTdIgch5iI6vBt3MJNXs3shIsM3+ZyysWhs3ipXnwT0g=="}],"size":3244,"noattachment":false,"key":"/configstore/-/configstore-7.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/configstore_7.0.0_1720908497604_0.6494077516980474"},"_hasShrinkwrap":false,"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```sh\nnpm install configstore\n```\n\n## Usage\n\n```js\nimport fs from 'node:fs';\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","publish_time":1720908497754,"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"sboudrias","email":"admin@simonboudrias.com"},{"name":"eddiemonge","email":"eddie+npm@eddiemonge.com"},{"name":"addyosmani","email":"addyosmani@gmail.com"},{"name":"mischah","email":"mail@michael-kuehnel.de"},{"name":"zckrs","email":"mehdy.dara.fr@gmail.com"},{"name":"ulisesgascon","email":"ulisesgascondev@gmail.com"},{"name":"mshima","email":"marceloshima@gmail.com"},{"name":"ruyadorno","email":"ruyadorno@hotmail.com"}],"_cnpm_publish_time":1720908497754,"dist-tags":{"latest":"8.0.0","legacy-v3":"3.1.5"}}