qortex-db
v0.1.0
Published
Browser-only Redis-like key-value database with localStorage, sessionStorage, and IndexedDB support
Maintainers
Readme
🗄️ qortex-db
Browser-only Redis-like key-value database. Simple, fast, consistent! 🚀
✨ What makes this special?
qortex-db provides a unified async API across browser storage backends:
- 💾 localStorage - Persists across sessions (default)
- 🔄 sessionStorage - Cleared on tab close
- 📦 IndexedDB - Larger storage capacity
npm install qortex-db🚀 Quick Start
import { createDB } from "qortex-db";
// Simple usage (uses localStorage)
const db = createDB("myapp");
// With options
const db = createDB({ name: "myapp", driver: "indexedDB" });
// Basic operations
await db.set("user:1", { name: "John", age: 30 });
const user = await db.get<User>("user:1");
const exists = await db.has("user:1");
await db.del("user:1");
// Pattern matching
const userKeys = await db.scan("user:*");
const allKeys = await db.scan("*");
// Clear all data
await db.drop();📖 API
| Method | Description |
|--------|-------------|
| get<T>(key) | Retrieve a value by key |
| set(key, value) | Store a value |
| has(key) | Check if key exists |
| del(key) | Delete a key |
| scan(pattern) | Find keys by pattern (* wildcard) |
| drop() | Delete all data for this database |
🔧 Drivers
| Driver | Persistence | Capacity | Use Case |
|--------|-------------|----------|----------|
| local | Permanent | ~5MB | Default, most common |
| session | Tab session | ~5MB | Temporary data |
| indexedDB | Permanent | Large | Large datasets |
📚 Documentation
Complete documentation available at:
🌐 qortex.darshannaik.com
📄 License
LGPL-3.0 License - see LICENSE file for details.
🎯 Support
- 📚 Documentation: qortex.darshannaik.com
- 📧 Email: darshannaik.com
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 🌟 Repository: https://github.com/Darshan-Naik/qortex
