Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosGoogle DeepMind: Create your own voices with Gemini 3.8 text-to-speech(23.09.2026 um 17:23 Uhr)
YouTube Security VideosAMD: The Evolution of CPU Architecture in the AI Era: S3 E6(23.09.2026 um 17:00 Uhr)
YouTube Security VideosBuilding AMD Helios: From Design to Rackscale AI Solutions(23.09.2026 um 17:30 Uhr)
YouTube Security VideosFlutter: Why Holafly switched to a cross-platform framework(23.09.2026 um 18:00 Uhr)
YouTube Security VideosGoogle Workspace: Create HD videos at no cost with Gemini in Google Vids(23.09.2026 um 18:00 Uhr)
Windows Tipps & SecurityUnable to extend volume in Hyper-V(23.09.2026 um 13:43 Uhr)
YouTube Security VideosGoogle DeepMind: Create your own voices with Gemini 3.8 text-to-speech(23.09.2026 um 17:23 Uhr)
YouTube Security VideosAMD: The Evolution of CPU Architecture in the AI Era: S3 E6(23.09.2026 um 17:00 Uhr)
YouTube Security VideosBuilding AMD Helios: From Design to Rackscale AI Solutions(23.09.2026 um 17:30 Uhr)
YouTube Security VideosFlutter: Why Holafly switched to a cross-platform framework(23.09.2026 um 18:00 Uhr)
YouTube Security VideosGoogle Workspace: Create HD videos at no cost with Gemini in Google Vids(23.09.2026 um 18:00 Uhr)
Windows Tipps & SecurityUnable to extend volume in Hyper-V(23.09.2026 um 13:43 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

ctrodb: A Client-Side Database for TypeScript — Zero Dependencies

I've been working on ctrodb — a client-side database for TypeScript that runs in the browser (IndexedDB) and Node.js (in-memory). Zero runtime dependencies. It started as a personal project to stop rewriting IndexedDB wrappers. Every new c…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

I've been working on ctrodb — a client-side database for TypeScript that runs in the browser (IndexedDB) and Node.js (in-memory). Zero runtime dependencies.



It started as a personal project to stop rewriting IndexedDB wrappers. Every new client-side app needed the same boilerplate: open a connection, create object stores, handle version upgrades, write CRUD helpers. After the sixth time, I wrote it once and got it right.






What it does



ctrodb gives you MongoDB-like CRUD with schema validation at write time:




import { Database } from "ctrodb"

const db = new Database({
name: "my-app",
schema: {
version: 1,
collections: {
notes: {
fields: {
title: { type: "string", required: true },
body: { type: "string" },
pinned: { type: "boolean", default: false },
tags: { type: "array", items: { type: "string" } },
createdAt: { type: "string", default: () => new Date().toISOString() },
},
indexes: [{ field: "createdAt" }],
},
},
},
})

await db.connect()
const notes = db.collection("notes")

const note = await notes.create({ title: "Hello", body: "World" })
const results = await notes.query()
.where("pinned", true)
.sort({ createdAt: "desc" })
.limit(10)
.fetch()






Every record is a Model — a Proxy wrapper with typed field access. note.title works. note.update() handles writes. Direct property assignment logs a warning telling you to use .update() instead.






What's included



The core package ships with three plugins:





  • Full-text search — inverted index, stop word removal, auto-indexed on create/update/delete


  • Relations — has_many, belongs_to, has_one with lazy accessors built into every Model and eager loading via .with()


  • Custom validation — extendable rules beyond the built-in validators (email, URL, regex)



Plus React hooks (separate import, same package):




import { DatabaseProvider, useQuery, useMutation } from "ctrodb/react"






Signal-based reactivity. When data changes, useQuery re-fetches and your UI updates. No Redux, no Zustand, no manual subscriptions.






Why zero dependencies



The library ships as ESM, CJS, and IIFE. Works with any bundler, any framework, or directly in a <script> tag. The entire source is 2,400 lines — readable, debuggable, and easy to contribute to.






Try it



There's a browser playground at https://ctrodb.vercel.app/playground where you can run all 7 examples without installing anything.




npm install ctrodb






GitHub: https://github.com/ctrotech-tutor/ctrodb

Docs: https://ctrodb.vercel.app/docs

NPM: https://www.npmjs.com/package/ctrodb



I'd love feedback on the API, the plugin system, or anything else.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten ctrodb: A Client-Side Database for TypeScript — Zero Dependencies

Thematisch verwandte Begriffe: ctrodb, ClientSide, Database, TypeScript · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-55610 | InvoiceShelf is an open-source web & mobile app that helps track expense…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick