A minimalist, fully-typed ORM for IndexedDB inspired by Prisma. Version 0.4.1, released as @latest. Zero dependencies, ~10KB uncompressed. Key differentiators: type-safe schema definition, query builder, migrations, transactions, event system, and integration with IndexedDB for offline-first web apps. Unlike raw IndexedDB, it provides a Prisma-like API with automatic type inference and simple migration handling.
npm install near-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows schema definition using defineSchema and field, initializing the ORM, and performing a create and read operation.
Update to v0.4.0+ and remove explicit default fields from seed data where possible.
Upgrade to v0.4.0+ to use upsert, or implement custom logic for create-or-update.
Ensure each model has exactly one field with primaryKey: true.
Only use near-orm in code that runs in a browser or with a polyfill like fake-indexeddb.
Update code to use db.models instead of direct db methods.
Ensure await ORM.init() completes before using db.models: const db = await ORM.init({ schema });Avoid calling db.close() prematurely, or ensure all operations are completed before closing.
Run db.migrate() after schema changes, or delete the IndexedDB database in browser DevTools to start fresh.
No dependency data recorded yet.