fs-storage-plus

0.0.5 • Public • Published

electron-storage-utils

Utils for storing plain and encrypted JSON in an Electron app's user data directory.

Installation

Using NPM:

npm install electron-storage-utils

Using Yarn:

yarn install electron-storage-utils

Usage

To store and retrieve plain JSON:

let settings = new Storage('settings', { darkMode: true });
 
settings.save().then(() => {
  // settings saved to user data
});
 
Storage.load('settings').then(instance => {
  // instance.data => { darkMode: true }
});

To store and retrieve encrypted JSON:

let secrets = new EncryptedStorage('secrets', { foo: 'bar' });
 
secrets.save().then(() => {
  // secrets encrypted and saved to user data
});
 
EncryptedStorage.load('secrets').then(instance => {
  // instance.data => { foo: 'bar' }
});

Readme

Keywords

Package Sidebar

Install

npm i fs-storage-plus

Weekly Downloads

0

Version

0.0.5

License

MIT

Last publish

Collaborators

  • alexblom
  • jordanyee
  • anulman