Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ionstore

fabiospampinato113kMIT1.0.1TypeScript support: included

A very simple isomorphic key-value store with a Map-like API for persisting session data.

simple, isomorphic, session, temporary, temp, store, storage

readme

IonStore

A very simple isomorphic key-value store with a Map-like API for persisting session data.

This module simply uses a temporary file under Node, and sessionStorage under a browser. Check out isostore if you need something a bit more sophisticated.

Install

npm install ionstore

Usage

import IonStore from 'ionstore';

// Creating a store, for temporary persistence

const store = new IonStore ( 'my-store' ); // The id of the store decides the name of the file on disk

store.has ( 'foo' ); // => false
store.set ( 'foo', 'some_string' ); // => store
store.get ( 'foo' ); // => 'some_string'
store.delete ( 'foo' ); // => true

License

MIT © Fabio Spampinato