Skip to content

Any data persistence library recommendation? #883

Answered by cawa-93
anothertempore asked this question in Q&A
Discussion options

You must be logged in to vote

https://github.com/cawa-93/electron-nano-store — A minimalistic, secure, type-safe data store for Electron

Usage

// In Electron Preload Script
import {defineStore} from 'electron-nano-store';

type UserStore = {
  role: 'admin' | 'user'
}

export const storePromise = defineStore<UserStore>('store-name');
// In Renderer
import { storePromise } from '#preload';

const store = await storePromise
store.get('role') // 'admin' | 'user'
store.set('role', 'wrong-role') // TS Error

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@anothertempore
Comment options

Answer selected by cawa-93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants