{"repo":"sindresorhus/electron-store","free":true,"listed":false,"github":"https://github.com/sindresorhus/electron-store","clone":"git clone https://github.com/sindresorhus/electron-store.git","description":"Simple data persistence for your Electron app or module - Save and load user preferences, app state, cache, etc","language":"JavaScript","stars":5015,"topics":["storage","user-preferences","config","preferences","electron","electron-module","data-persistence","npm-package"],"license":"MIT","category":"ecommerce","readme_excerpt":"electron-store Simple data persistence for your Electron app or module - Save and load user settings, app state, cache, etc Electron doesn't have a built-in way to persist user settings and other data. This module handles that for you, so you can focus on building your app. The data is saved in a JSON file named config.json in app.getPath('userData') . [!NOTE] This is not a database. The entire JSON file is read and written on every change, so it's best suited for small data like user settings. For large data, use SQLite or similar. You can use this module directly in both the main and renderer process. For use in the renderer process only, you need to call Store.initRenderer() in the main process, or create a new Store instance ( new Store() ) in the main process. Install Requires Electron 30 or later. [!NOTE] This package is native ESM and no longer provides a CommonJS export. If your project uses CommonJS, you will have to convert to ESM. More info about Electron and ESM. Please don't open issues for questions regarding CommonJS and ESM. Usage API Changes are written to disk atomically, so if the process crashes during a write, it will not corrupt the existing config. Store(options?) Returns a new instance. options Type: object defaults Type: object Default values for the store items. Note: The values in defaults will overwrite the default key in the schema option. schema type: object JSON Schema to validate your config data. Under the hood, the JSON Schema validator ajv i","default_branch":null,"files":null,"tree":[],"storefront":"/r/sindresorhus","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sindresorhus/electron-store/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}