{"_id":"@cjser/configstore__v7_1_0","name":"@cjser/configstore__v7_1_0","dist-tags":{"latest":"7.1.0-cjser.2"},"versions":{"7.1.0-cjser.2":{"name":"@cjser/configstore__v7_1_0","version":"7.1.0-cjser.2","description":"Easily load and save config without having to think about where and how","license":"BSD-2-Clause","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"types":"./index.d.ts","sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["config","store","storage","configuration","settings","preferences","json","data","persist","persistent","save"],"dependencies":{"graceful-fs":"^4.2.11","@cjser/atomically":"2.1.1-cjser.2","@cjser/dot-prop__v9_0_0":"9.0.0-cjser.2","@cjser/xdg-basedir":"5.1.0-cjser.2"},"devDependencies":{"ava":"^6.2.0","xo":"^0.60.0"},"ava":{"serial":true},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"7.1.0","cjserVersion":2,"original":{"name":"configstore","version":"7.1.0","exports":"./index.js","repository":"sindresorhus/configstore","dependencies":{"atomically":"^2.0.3","dot-prop":"^9.0.0","graceful-fs":"^4.2.11","xdg-basedir":"^5.1.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava"}}},"_id":"@cjser/configstore__v7_1_0@7.1.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-Y2mOVJIzVodaDX76jhWhyjQugmEJ6xRGXl4eNzy6CRJmliA/8Hlv/pelVwVVIbHgNnG/MPZlBksUl9bFykrsCQ==","shasum":"f7516553edaf568bee81130ec78111e4b3a8d2b8","tarball":"https://registry.npmjs.org/@cjser/configstore__v7_1_0/-/configstore__v7_1_0-7.1.0-cjser.2.tgz","fileCount":6,"unpackedSize":16969,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCcyX9G2KaPKJ7t2TP/ERJJQZpUylUAQwzgGHT4BuyCQQIhAJiXOgKO3MtfK01n2p5npjg7Ifa0E2DvGMmryazRi8k8"}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/configstore__v7_1_0_7.1.0-cjser.2_1778157707979_0.36573208690746895"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T12:41:47.859Z","7.1.0-cjser.2":"2026-05-07T12:41:48.118Z","modified":"2026-05-07T12:41:48.316Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Easily load and save config without having to think about where and how","keywords":["config","store","storage","configuration","settings","preferences","json","data","persist","persistent","save"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"BSD-2-Clause","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\n// Use default values with nullish coalescing\nconsole.log(config.get('nonexistent') ?? 'default value');\n//=> 'default value'\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##### clearInvalidConfig\n\nType: `boolean`\\\nDefault: `true`\n\nClear the config file if it contains invalid JSON. If set to `false`, a `SyntaxError` will be thrown instead of clearing the file. This allows you to recover corrupted config files manually.\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\nYou can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.\n\n### .set(object)\n\nSet multiple items at once.\n\n### .get(key)\n\nGet an item.\n\nYou can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.\n\n> [!TIP]\n> Use the [nullish coalescing operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) (`??`) to provide default values:\n> ```js\n> const value = config.get('key') ?? 'default value';\n> ```\n\n### .has(key)\n\nCheck if an item exists.\n\nYou can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.\n\n### .delete(key)\n\nDelete an item.\n\nYou can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.\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## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/configstore\n","readmeFilename":"readme.md","_rev":"1-7212c7bcb68f55a1f8cea357a9150079"}