{"_id":"electron-conf","_rev":"6-b5075a6e6f39be62becbfc060faac960","name":"electron-conf","dist-tags":{"alpha":"1.0.0-alpha.0","latest":"1.3.0"},"versions":{"1.0.0-alpha.0":{"name":"electron-conf","version":"1.0.0-alpha.0","keywords":["config","settings","store","storage","electron"],"author":{"name":"Alex Wei","email":"https://github.com/alex8088"},"license":"MIT","_id":"electron-conf@1.0.0-alpha.0","maintainers":[{"name":"alex.wei","email":"244096523@qq.com"}],"homepage":"https://github.com/alex8088/electron-conf#readme","bugs":{"url":"https://github.com/alex8088/electron-conf/issues"},"dist":{"shasum":"081dfea9d989f358e6337904beb9b1b1e96e7aec","tarball":"https://registry.npmjs.org/electron-conf/-/electron-conf-1.0.0-alpha.0.tgz","fileCount":14,"integrity":"sha512-mGr296AFbRPTuuly/1xDtVx9gwFzm/JW3SWidRMQXPT20jmYKVM3Fu/Yv6YfgCwv/9Mw0Ns8sfKDASVqdc+h4A==","signatures":[{"sig":"MEQCIHj4DIAsRa3ueMqDleoxNBIP2Nys+2+07o9AtKYPrVPEAiBnDWdwF3HbxIA7X+5pMCh+79+sCCGIRqu+l5T2RNg4pw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49128},"main":"./dist/main.cjs","types":"./dist/main.d.ts","module":"./dist/main.mjs","exports":{".":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./preload":{"types":"./dist/preload.d.ts","import":"./dist/preload.mjs","require":"./dist/preload.cjs"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.mjs","require":"./dist/renderer.cjs"}},"scripts":{"lint":"eslint --ext .js,.cjs,.mjs,.ts,.cts,.mts src/**","test":"vitest run","build":"npm run lint && rollup -c rollup.config.ts --configPlugin typescript","format":"prettier --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alex.wei","email":"244096523@qq.com"},"repository":{"url":"git+https://github.com/alex8088/electron-conf.git","type":"git"},"_npmVersion":"9.8.1","description":"Simple data persistence for your Electron app - save and load user settings, app state, cache, etc","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ajv":"^8.13.0","dot-prop":"^9.0.0","atomically":"^2.0.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","rollup":"^4.17.2","vitest":"^1.6.0","prettier":"^3.2.5","typescript":"^5.4.5","@types/node":"^18.19.33","rollup-plugin-rm":"^1.0.2","rollup-plugin-dts":"^6.1.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-typescript":"^11.1.6","@typescript-eslint/parser":"^7.9.0","@rollup/plugin-node-resolve":"^15.2.3","@typescript-eslint/eslint-plugin":"^7.9.0"},"peerDependencies":{"electron":">=13.0.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-conf_1.0.0-alpha.0_1716127025052_0.026107740605980645","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"electron-conf","version":"1.0.0","keywords":["config","settings","store","storage","electron"],"author":{"name":"Alex Wei","email":"https://github.com/alex8088"},"license":"MIT","_id":"electron-conf@1.0.0","maintainers":[{"name":"alex.wei","email":"244096523@qq.com"}],"homepage":"https://github.com/alex8088/electron-conf#readme","bugs":{"url":"https://github.com/alex8088/electron-conf/issues"},"dist":{"shasum":"f47278b1bb8a0448054fbb4b8ce78ce95389d056","tarball":"https://registry.npmjs.org/electron-conf/-/electron-conf-1.0.0.tgz","fileCount":14,"integrity":"sha512-AFOCQ23kzUKwdXgKThdK/S5NKINteql+1aM0YhrWUvfPxPZre6WZXVaStR8SK0PhL4OiIOxehWME2nwsj94Uwg==","signatures":[{"sig":"MEUCIQDMlVU/Hz0akG+qq5KqnUWDAIdyNq9QPn02yhfTday7hwIgGcIUbPS90wDaovU+gmZkyzVBNbluPMoIw+RtwlAEHTE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49334},"main":"./dist/main.cjs","types":"./dist/main.d.ts","module":"./dist/main.mjs","exports":{".":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./preload":{"types":"./dist/preload.d.ts","import":"./dist/preload.mjs","require":"./dist/preload.cjs"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.mjs","require":"./dist/renderer.cjs"}},"gitHead":"d042de296ad16f3415bff0d3924b3cec72547b11","scripts":{"lint":"eslint --ext .js,.cjs,.mjs,.ts,.cts,.mts src/**","test":"vitest run","build":"npm run lint && rollup -c rollup.config.ts --configPlugin typescript","format":"prettier --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alex.wei","email":"244096523@qq.com"},"repository":{"url":"git+https://github.com/alex8088/electron-conf.git","type":"git"},"_npmVersion":"9.8.1","description":"Simple data persistence for your Electron app - save and load user settings, app state, cache, etc","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ajv":"^8.13.0","dot-prop":"^9.0.0","atomically":"^2.0.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","rollup":"^4.17.2","vitest":"^1.6.0","prettier":"^3.2.5","typescript":"^5.4.5","@types/node":"^18.19.33","rollup-plugin-rm":"^1.0.2","rollup-plugin-dts":"^6.1.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-typescript":"^11.1.6","@typescript-eslint/parser":"^7.9.0","@rollup/plugin-node-resolve":"^15.2.3","@typescript-eslint/eslint-plugin":"^7.9.0"},"peerDependencies":{"electron":">=13.0.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-conf_1.0.0_1716211167857_0.9732710909721987","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"electron-conf","version":"1.1.0","keywords":["config","settings","store","storage","electron"],"author":{"name":"Alex Wei","email":"https://github.com/alex8088"},"license":"MIT","_id":"electron-conf@1.1.0","maintainers":[{"name":"alex.wei","email":"244096523@qq.com"}],"homepage":"https://github.com/alex8088/electron-conf#readme","bugs":{"url":"https://github.com/alex8088/electron-conf/issues"},"dist":{"shasum":"c2d56f6fcc85083e408981b0c4434ca66e60678d","tarball":"https://registry.npmjs.org/electron-conf/-/electron-conf-1.1.0.tgz","fileCount":14,"integrity":"sha512-dKhEg0QYTaV6uGABVv93fn29mVUzf6aT60vh8DG9U3+2q47t/bcWr81pInqPjDw/n/5y2utT+kbYuZH6n8x37w==","signatures":[{"sig":"MEUCIQC5OWiM8VTaJUJpFIxkGpMWABLeum1UbRk9AhG3wWsFeQIgZtQU/bL87sDD6t/NWxLzvnc7wNGJVxuHN7B8eNA6al8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92133},"main":"./dist/main.cjs","types":"./dist/main.d.ts","module":"./dist/main.mjs","exports":{".":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./preload":{"types":"./dist/preload.d.ts","import":"./dist/preload.mjs","require":"./dist/preload.cjs"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.mjs","require":"./dist/renderer.cjs"}},"gitHead":"3eeef5d0efb07ef39b7598a34e65a5c64310ffa0","scripts":{"lint":"eslint --ext .js,.cjs,.mjs,.ts,.cts,.mts src/**","test":"vitest run","build":"npm run lint && rollup -c rollup.config.ts --configPlugin typescript","format":"prettier --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alex.wei","email":"244096523@qq.com"},"repository":{"url":"git+https://github.com/alex8088/electron-conf.git","type":"git"},"_npmVersion":"9.8.1","description":"Simple data persistence for your Electron app - save and load user settings, app state, cache, etc","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ajv":"^8.13.0"},"typesVersions":{"*":{"main":["./dist/main.d.ts"],"preload":["./dist/preload.d.ts"],"renderer":["./dist/renderer.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","rollup":"^4.17.2","vitest":"^1.6.0","dot-prop":"^9.0.0","prettier":"^3.2.5","atomically":"^2.0.3","typescript":"^5.4.5","@types/node":"^18.19.33","rollup-plugin-rm":"^1.0.2","rollup-plugin-dts":"^6.1.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-typescript":"^11.1.6","@typescript-eslint/parser":"^7.9.0","@rollup/plugin-node-resolve":"^15.2.3","@typescript-eslint/eslint-plugin":"^7.9.0"},"peerDependencies":{"electron":">=13.0.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-conf_1.1.0_1716388823896_0.3967028779520063","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"electron-conf","version":"1.2.0","keywords":["config","settings","store","storage","electron"],"author":{"name":"Alex Wei","email":"https://github.com/alex8088"},"license":"MIT","_id":"electron-conf@1.2.0","maintainers":[{"name":"alex.wei","email":"244096523@qq.com"}],"homepage":"https://github.com/alex8088/electron-conf#readme","bugs":{"url":"https://github.com/alex8088/electron-conf/issues"},"dist":{"shasum":"dd1df07f12e47d5facf13cdc621c7aa5e2c87e56","tarball":"https://registry.npmjs.org/electron-conf/-/electron-conf-1.2.0.tgz","fileCount":14,"integrity":"sha512-PZrIqvCdB+9Uh7+M7Rys/UbvN1Nr5JbZrGMzSOS5yoHd/gL+Mcv6HCvpDJaUHtosVr7unRTaHFC8CI+RL5NC8g==","signatures":[{"sig":"MEUCIQDfrxuqN3HBKEih4orTF2h2onUMJvkpdnkS2vL3jnfNOwIgd/HhQkB0zvzOD3dCV/tGaLh3v1H7PE5AL1bHtGdRdtQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92703},"main":"./dist/main.cjs","types":"./dist/main.d.ts","module":"./dist/main.mjs","exports":{".":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./preload":{"types":"./dist/preload.d.ts","import":"./dist/preload.mjs","require":"./dist/preload.cjs"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.mjs","require":"./dist/renderer.cjs"}},"gitHead":"02c167c52ff6fa2f960ad20e0857201cf018cf7a","scripts":{"lint":"eslint --ext .js,.cjs,.mjs,.ts,.cts,.mts src/**","test":"vitest run","build":"npm run lint && rollup -c rollup.config.ts --configPlugin typescript","format":"prettier --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alex.wei","email":"244096523@qq.com"},"repository":{"url":"git+https://github.com/alex8088/electron-conf.git","type":"git"},"_npmVersion":"9.8.1","description":"Simple data persistence for your Electron app - save and load user settings, app state, cache, etc","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ajv":"^8.13.0"},"typesVersions":{"*":{"main":["./dist/main.d.ts"],"preload":["./dist/preload.d.ts"],"renderer":["./dist/renderer.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","rollup":"^4.17.2","vitest":"^1.6.0","dot-prop":"^9.0.0","prettier":"^3.2.5","atomically":"^2.0.3","typescript":"^5.4.5","@types/node":"^18.19.33","rollup-plugin-rm":"^1.0.2","rollup-plugin-dts":"^6.1.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-typescript":"^11.1.6","@typescript-eslint/parser":"^7.9.0","@rollup/plugin-node-resolve":"^15.2.3","@typescript-eslint/eslint-plugin":"^7.9.0"},"peerDependencies":{"electron":">=15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-conf_1.2.0_1723363019524_0.3147725340220078","host":"s3://npm-registry-packages"}},"1.2.1":{"name":"electron-conf","version":"1.2.1","keywords":["config","settings","store","storage","electron"],"author":{"name":"Alex Wei","email":"https://github.com/alex8088"},"license":"MIT","_id":"electron-conf@1.2.1","maintainers":[{"name":"alex.wei","email":"244096523@qq.com"}],"homepage":"https://github.com/alex8088/electron-conf#readme","bugs":{"url":"https://github.com/alex8088/electron-conf/issues"},"dist":{"shasum":"9381b0c6f5337cf86dd68190880abbf11e41578b","tarball":"https://registry.npmjs.org/electron-conf/-/electron-conf-1.2.1.tgz","fileCount":14,"integrity":"sha512-MjREzEIA77VpwX+gSviMgCdse7KuuaQEY13rqka96DKlm9xdEP7adMOX+7Z9gFr5lZTmAxLjmHz5XJ0xweED3Q==","signatures":[{"sig":"MEYCIQCPY27d72Zddwkx/g7OzilD93glyxQoLmv4iy1K/WkCCQIhAP0r2GsumremnUMXQeiClrVm5XAl90PW3XPxXCnGMV3y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92717},"main":"./dist/main.cjs","types":"./dist/main.d.ts","module":"./dist/main.mjs","exports":{".":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./preload":{"types":"./dist/preload.d.ts","import":"./dist/preload.mjs","require":"./dist/preload.cjs"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.mjs","require":"./dist/renderer.cjs"}},"gitHead":"e2f3114420f94340e269140546bf49fe9ebb23d1","scripts":{"lint":"eslint --ext .js,.cjs,.mjs,.ts,.cts,.mts src/**","test":"vitest run","build":"npm run lint && rollup -c rollup.config.ts --configPlugin typescript","format":"prettier --write .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alex.wei","email":"244096523@qq.com"},"repository":{"url":"git+https://github.com/alex8088/electron-conf.git","type":"git"},"_npmVersion":"9.8.1","description":"Simple data persistence for your Electron app - save and load user settings, app state, cache, etc","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ajv":"^8.13.0"},"typesVersions":{"*":{"main":["./dist/main.d.ts"],"preload":["./dist/preload.d.ts"],"renderer":["./dist/renderer.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","rollup":"^4.17.2","vitest":"^1.6.0","dot-prop":"^9.0.0","prettier":"^3.2.5","atomically":"^2.0.3","typescript":"^5.4.5","@types/node":"^18.19.33","rollup-plugin-rm":"^1.0.2","rollup-plugin-dts":"^6.1.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-typescript":"^11.1.6","@typescript-eslint/parser":"^7.9.0","@rollup/plugin-node-resolve":"^15.2.3","@typescript-eslint/eslint-plugin":"^7.9.0"},"peerDependencies":{"electron":">=15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/electron-conf_1.2.1_1724247779541_0.020622608932711284","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"electron-conf","version":"1.3.0","description":"Simple data persistence for your Electron app - save and load user settings, app state, cache, etc","main":"./dist/main.cjs","module":"./dist/main.mjs","types":"./dist/main.d.ts","exports":{".":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./main":{"types":"./dist/main.d.ts","import":"./dist/main.mjs","require":"./dist/main.cjs"},"./preload":{"types":"./dist/preload.d.ts","import":"./dist/preload.mjs","require":"./dist/preload.cjs"},"./renderer":{"types":"./dist/renderer.d.ts","import":"./dist/renderer.mjs","require":"./dist/renderer.cjs"}},"typesVersions":{"*":{"main":["./dist/main.d.ts"],"preload":["./dist/preload.d.ts"],"renderer":["./dist/renderer.d.ts"]}},"author":{"name":"Alex Wei","email":"https://github.com/alex8088"},"license":"MIT","homepage":"https://github.com/alex8088/electron-conf#readme","repository":{"type":"git","url":"git+https://github.com/alex8088/electron-conf.git"},"bugs":{"url":"https://github.com/alex8088/electron-conf/issues"},"keywords":["config","settings","store","storage","electron"],"scripts":{"format":"prettier --write .","lint":"eslint --ext .js,.cjs,.mjs,.ts,.cts,.mts src/**","typecheck":"tsc --noEmit","build":"npm run lint && rollup -c rollup.config.ts --configPlugin typescript","test":"vitest run"},"peerDependencies":{"electron":">=15.0.0"},"dependencies":{"ajv":"^8.13.0"},"devDependencies":{"@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-typescript":"^11.1.6","@types/node":"^18.19.33","@typescript-eslint/eslint-plugin":"^7.9.0","@typescript-eslint/parser":"^7.9.0","atomically":"^2.0.3","dot-prop":"^9.0.0","eslint":"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","prettier":"^3.2.5","rollup":"^4.17.2","rollup-plugin-dts":"^6.1.0","rollup-plugin-rm":"^1.0.2","typescript":"^5.4.5","vitest":"^1.6.0"},"_id":"electron-conf@1.3.0","gitHead":"abefc617fb9d4b6c2d5ff9536ba67ccbe3e3ac4a","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-F1F33QntbFiRsmCW4r8n+CqfTmBzw9XhCWVh27weFpfCNATo9n0K1h1UQLEG5kYBZRqMfcWr1+IHSO+Yd7seRQ==","shasum":"5ad926c8667c547cde5561ac04bafeef8c10c64c","tarball":"https://registry.npmjs.org/electron-conf/-/electron-conf-1.3.0.tgz","fileCount":14,"unpackedSize":93049,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCpX4P78nAxE3Jivi2QL3cNj/07sGc2BcTYEIZk4obtdAIhAIIQq8PUKZ/nc6ZH3U6ktwRqPNCgoSKpmnhxoXiV0hSm"}]},"_npmUser":{"name":"alex.wei","email":"244096523@qq.com"},"directories":{},"maintainers":[{"name":"alex.wei","email":"244096523@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/electron-conf_1.3.0_1742136587472_0.20472086274835943"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-19T13:57:05.051Z","modified":"2025-03-16T14:49:47.793Z","1.0.0-alpha.0":"2024-05-19T13:57:05.213Z","1.0.0":"2024-05-20T13:19:28.183Z","1.1.0":"2024-05-22T14:40:24.169Z","1.2.0":"2024-08-11T07:56:59.852Z","1.2.1":"2024-08-21T13:42:59.762Z","1.3.0":"2025-03-16T14:49:47.630Z"},"bugs":{"url":"https://github.com/alex8088/electron-conf/issues"},"author":{"name":"Alex Wei","email":"https://github.com/alex8088"},"license":"MIT","homepage":"https://github.com/alex8088/electron-conf#readme","keywords":["config","settings","store","storage","electron"],"repository":{"type":"git","url":"git+https://github.com/alex8088/electron-conf.git"},"description":"Simple data persistence for your Electron app - save and load user settings, app state, cache, etc","maintainers":[{"name":"alex.wei","email":"244096523@qq.com"}],"readme":"# electron-conf\n\n> Simple data persistence for your Electron app - save and load user settings, app state, cache, etc\n\n> Another electron-store, minimal fork of conf, with more features.\n\nelectron-conf is a fork of [conf](https://github.com/sindresorhus/conf) (behind [electron-store](https://github.com/sindresorhus/electron-store)). What we try to achieve in this library, is to eliminate some dependencies and features that our target users don't need, and is designed only for Electron.\n\n- ✅ Minimal and simple\n- ✅ Read data form disk once, ~100x faster\n- ✅ Simpler migration strategy\n- ✅ Safer to use it in Electron renderer (no nodeIntegration)\n- ✅ Written in TypeScript, and support CommonJS and ESM. For Electron 15.x and higher.\n- ❌ No watch\n- ❌ No encryption\n\n_If you need features like watch or encryption, electron-store is a better choice for you._\n\n## Install\n\n```sh\n$ npm install electron-conf\n```\n\n## Usage\n\n### Using in Electron Main Process\n\n```ts\nimport { Conf } from 'electron-conf/main'\n\nconst conf = new Conf()\n\nconf.set('foo', '🌈')\nconsole.log(conf.get('foo')) // => 🌈\n\n// Use dot-notation to access nested properties\nconf.set('a.b', true)\nconsole.log(conf.get('a')) // => {b: true}\n\nconf.delete('foo')\nconsole.log(conf.get('foo')) // => undefined\n```\n\n### Using in Electron Renderer Process\n\n1. Register a listener in main process, so that you can use it in the renderer process.\n\n```ts\nimport { Conf } from 'electron-conf/main'\n\nconst conf = new Conf()\n\nconf.registerRendererListener()\n```\n\n2. Expose the `Conf` API.\n\nYou can expose it in the specified preload script:\n\n```ts\nimport { exposeConf } from 'electron-conf/preload'\n\nexposeConf()\n```\n\nOr, you can expose it globally in the main process for all renderer processes:\n\n```ts\nimport { useConf } from 'electron-conf/main'\n\nuseConf()\n```\n\n3. Use it in the renderer process\n\n```ts\nimport { Conf } from 'electron-conf/renderer'\n\nconst conf = new Conf()\n\nawait conf.set('foo', 1)\n```\n\n> [!NOTE]\n> Use the same way as the main process. The difference is that all APIs are promise-based.\n\n## API\n\n### Conf([options])\n\nreturn a new instance.\n\n> [!WARNING]\n> It does not support multiple instances reading and writing the same configuration file.\n\n### Constructor Options\n\n> [!NOTE]\n> `Conf` for the renderer process, only supports the `name` option.\n\n#### `dir`\n\n- Type: `string`\n- Default: [`app.getPath('userData')`](https://www.electronjs.org/docs/latest/api/app#appgetpathname)\n\nThe directory for storing your app's configuration file.\n\n#### `name`\n\n- Type: `string`\n- Default: `config`\n\nConfiguration file name without extension.\n\n#### `ext`\n\n- Type: `string`\n- Default: `.json`\n\nConfiguration file extension.\n\n#### `defaults`\n\n- Type: `object`\n\nDefault config used if there are no existing config.\n\n#### `serializer`\n\n- Type: [`Serializer`](./src/types.ts)\n\nProvides functionality to serialize object types to UTF-8 strings and to deserialize UTF-8 strings into object types.\n\nBy default, `JSON.stringify` is used for serialization and `JSON.parse` is used for deserialization.\n\nYou would usually not need this, but it could be useful if you want to use a format other than JSON.\n\n<details>\n<summary><b>Type Signature</b></summary>\n<p></p>\n\n```ts\ninterface Serializer<T> {\n  /**\n   * Deserialize the config object from a UTF-8 string when reading the config file.\n   * @param raw UTF-8 encoded string.\n   */\n  read: (raw: string) => T\n  /**\n   * Serialize the config object to a UTF-8 string when writing the config file.\n   * @param value The config object.\n   */\n  write: (value: T) => string\n}\n```\n\n</details>\n\n#### `schema`\n\n- Type: [JSONSchema](https://json-schema.org/understanding-json-schema/reference/object#properties)\n\n[JSON Schema](https://json-schema.org) to validate your config data.\n\nUnder the hood, we use the [ajv](https://ajv.js.org/) JSON Schema validator to validate config data.\n\nYou should define your schema as an object where each key is the name of your data's property and each value is a JSON schema used to validate that property.\n\n```ts\nimport { Conf } from 'electron-conf/main'\n\nconst schema = {\n  type: 'object',\n  properties: {\n    foo: {\n      type: 'string',\n      maxLength: 10,\n      nullable: true\n    }\n  }\n}\n\nconst conf = new Conf({ schema })\n```\n\n#### `migrations`\n\n- type: [`Migration[]`](./src/types.ts)\n\nYou can customize versions and perform operations to migrate configurations. When instantiated, it will be compared with the version number of the configuration file and a higher version migration operation will be performed.\n\n**Note:** The migration version must be greater than `0`. A new version is defined on each migration and is incremented on the previous version.\n\n```ts\nimport { Conf } from 'electron-conf/main'\n\nconst migrations = [\n  {\n    version: 1,\n    hook: (conf, version): void => {\n      conf.set('foo', 'a')\n      console.log(`migrate from ${version} to 1`) // migrate from 0 to 1\n    }\n  },\n  {\n    version: 2,\n    hook: (conf, version): void => {\n      conf.set('foo', 'b')\n      console.log(`migrate from ${version} to 2`) // migrate from 1 to 2\n    }\n  }\n]\n\nconst conf = new Conf({ migrations })\n```\n\n<details>\n<summary><b>Type Signature</b></summary>\n<p></p>\n\n```ts\ntype Migration<T extends Record<string, any>> = {\n  /**\n   * Migration version. The initial version must be greater than `0`. A new\n   * version is defined on each migration and is incremented on the previous version.\n   */\n  version: number\n  /**\n   * Migration hook. You can perform operations to update your configuration.\n   * @param instance config instance.\n   * @param currentVersion current version.\n   */\n  hook: (instance: BaseConf<T>, currentVersion: number) => void\n}\n```\n\n</details>\n<p></p>\n\n### Instance Methods\n\nYou can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a key to access nested properties.\n\nThe instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.\n\n> [!NOTE]\n> All methods in renderer are promise-based.\n\n#### `.get(key, defaultValue?)`\n\nGet an item or defaultValue if the item does not exist.\n\n#### `.set(key, value)`\n\nSet an item.\n\n#### `.set(object)`\n\nSet an item or multiple items at once.\n\n```js\nconf.set({ foo: 'boo', bar: { baz: 1 } })\n```\n\n#### `.reset(...keys)`\n\nReset items to their default values, as defined by the defaults or schema option.\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#### `.onDidChange(key, callback)`\n\n- `callback`: `(newValue, oldValue) => {}`\n\nWatches the given `key`, calling `callback` on any changes.\n\nWhen a key is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.\n\nReturns a function which you can use to unsubscribe:\n\n```js\nconst unsubscribe = conf.onDidChange(key, callback)\n\nunsubscribe()\n```\n\n> [!TIP]\n> Not available in renderer\n\n#### `.onDidAnyChange(callback)`\n\n- `callback`: `(newValue, oldValue) => {}`\n\nWatches the whole config object, calling `callback` on any changes.\n\n`oldValue` and `newValue` will be the config object before and after the change, respectively. You must compare `oldValue` to `newValue `to find out what changed.\n\nReturns a function which you can use to unsubscribe:\n\n```js\nconst unsubscribe = store.onDidAnyChange(callback)\n\nunsubscribe()\n```\n\n> [!TIP]\n> Not available in renderer\n\n#### `.fileName`\n\nGet the configuration file path.\n\n> [!TIP]\n> Not available in renderer\n\n## Credits\n\n[Conf](https://github.com/sindresorhus/conf), simple config handling for your app or module.\n","readmeFilename":"README.md"}