Simple data persistence for your Electron app or module. Save and load user preferences, app state, cache, etc. Electron doesn't have a built-in way to persist user preferences and other data. This module handles that for you, so you can focus on building your app. 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. Changes are written to disk atomically, so if the process crashes during a write, it will not corrupt the existing config. Under the hood, the JSON Schema validator ajv is used to validate your config. We use JSON Schema draft-07 and support all validation keywords and formats. You 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.

Features

  • Changes are written to disk atomically
  • Electron doesn't have a built-in way to persist user preferences and other data
  • Simple data persistence for your Electron app or module
  • Save and load user preferences, app state, cache, etc.
  • Under the hood, the JSON Schema validator ajv is used to validate your config
  • The default value will be overwritten by the defaults option if set

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

MIT License

Follow electron-store

electron-store Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of electron-store!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

JavaScript

Related Categories

JavaScript Frameworks

Registered

2022-09-23