A Redis-like async key-value database for browsers. Unified API across localStorage, sessionStorage, and IndexedDB.
npm install qortex-dbimport { createDB } from 'qortex-db';// Simple usage (uses localStorage by default)const db = createDB('myapp');// Or with optionsconst db = createDB({ name: 'myapp', driver: 'indexedDB' });// Store dataawait db.set('user:1', { name: 'John', age: 30 });// Retrieve dataconst user = await db.get<User>('user:1');// Check existenceconst exists = await db.has('user:1');// Deleteawait db.del('user:1');// Find keys by patternconst userKeys = await db.scan('user:*');// Clear all dataawait db.drop();
Same async interface for all storage backends
localStorage, sessionStorage, and IndexedDB
Full type inference and safety
Data isolation between database instances
Find keys with wildcard patterns
Under 3KB minified and gzipped
| Method | Description |
|---|---|
get<T>(key) | Retrieve a value by key |
set(key, value) | Store a value (JSON serialized) |
has(key) | Check if a key exists |
del(key) | Delete a key-value pair |
scan(pattern) | Find keys matching pattern (* wildcard) |
drop() | Delete all data for this database |
localDefault, most common use case
sessionCleared when tab closes
indexedDBFor large datasets
Lightweight and optimized for performance.
1.2KB / 10KB Performance Budget