Dalmart Forage
Dalmart Forage implements the Dalmart key-value interface using localForage for
browser storage such as IndexedDB. Run it in a browser with a supported
localForage storage driver. The database option configures the name of the
shared localForage instance.
Installation
npm install @zthun/dalmart-forage @zthun/dalmart-db
# Or use Yarn
yarn add @zthun/dalmart-forage @zthun/dalmart-db
Features
Usage
import type { IZDatabaseMemory } from "@zthun/dalmart-db";
import { ZDatabaseOptionsBuilder } from "@zthun/dalmart-db";
import { ZDatabaseForage } from "@zthun/dalmart-forage";
const options = new ZDatabaseOptionsBuilder().database("local-data").build();
const database: IZDatabaseMemory = new ZDatabaseForage(options);
await database.upsert("theme", "dark");
const theme = await database.read<string>("theme");