ionstore

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

MIT 2 个版本
安装
npm install ionstore
yarn add ionstore
pnpm add ionstore
bun add ionstore
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

版本列表
1.0.1 2025-01-12
1.0.0 2023-08-03