0.1.4 • Published 10 months ago

userdata-storage v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

userdata-storage

Simple JSON storage based on system user data folder.

This project is created by create-a-typescript-lib.

Usage

Step 1: Install package

$ npm install userdata-storage

Step 2: Import and use this library

import UserDataStorage from 'userdata-storage';

const storage = new UserDataStorage({
  appName: '<appName>',
  storageName: '[storageName]', // optional
  safeKey: '[safeKey]', // better for security, can avoid others to read the data.
});

await storage.set(key, payload);
await storage.get(key);
await storage.remove(key);

// or using the synchronous methods (⚠ The methods include locks, be aware of dead lock)

storage.setSync(key, payload);
storage.getSync(key);
storage.removeSync(key);

License

MIT

0.1.0

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.0.1

2 years ago