electron-data-storage
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

electron-data-storage

Simple data persistence for Electron app, It's Thread safety, Can be called directly from the main process and the renderer process.

npm version license

Installation

$ npm install electron-data-storage

or

$ yarn add electron-data-storage

Usage

import storage from 'electron-data-storage'

storage.set('hi', 'Hello World!')
storage.get('hi')
storage.remove('hi')
storage.clear()

You can require this module in Electron main or renderer process.

API

set

storage.set(key: string, value: string | number | boolean)

storage.set(key, value)

get

storage.get(key: string): string | number | boolean | undefined

const value = storage.get(key)
console.log(value)

remove

storage.remove(key: string)

storage.remove(key)

clear

storage.clear()

storage.clear()

Tests

Use Jest, edit in test/index.tset.ts

$ yarn test

Contribute

Contributions are welcome! please open issues and pull request :)

License

The project is licensed under the MIT license.

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i electron-data-storage

    Weekly Downloads

    3

    Version

    1.1.3

    License

    MIT

    Unpacked Size

    8.26 kB

    Total Files

    8

    Last publish

    Collaborators

    • lzdyes