npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mikesaintsg/indexeddb

v0.0.1

Published

Type-safe IndexedDB wrapper with transaction management, migrations, and full TypeScript support. Zero runtime dependencies.

Readme

@mikesaintsg/indexeddb

A focused IndexedDB wrapper that enhances the native API without abstracting it away

Features

  • Type Safety — Generic schema types with full TypeScript support
  • Promise-based — Async/await instead of event callbacks
  • Ergonomic API — Simplified CRUD, batch operations, query builder
  • Native Access — Full access to underlying IndexedDB objects
  • Auto-batching — Array operations use single transaction
  • Cross-tab Sync — Built-in BroadcastChannel integration
  • Query Builder — Fluent API mapping to IDBKeyRange
  • Transactions — Multi-store atomic operations
  • Migrations — Version-based schema migrations
  • Cursors — Async generators with early break support
  • Zero Dependencies — Built entirely on Web Platform APIs

Installation

npm install @mikesaintsg/indexeddb

Note: This package depends on @mikesaintsg/core for shared types. Import shared types directly:

import type { Unsubscribe, ChangeSource, PruneResult, StorageInfo } from '@mikesaintsg/core'
import { createDatabase } from '@mikesaintsg/indexeddb'

Quick Start

import { createDatabase } from '@mikesaintsg/indexeddb'

// Define schema
interface User {
	readonly id: string
	readonly name: string
	readonly email: string
	readonly status: 'active' | 'inactive'
}

interface AppSchema {
	readonly users: User
}

// Create database
const db = await createDatabase<AppSchema>({
	name: 'myApp',
	version: 1,
	stores: {
		users: {
			indexes: [
				{ name: 'byEmail', keyPath: 'email', unique: true },
				{ name: 'byStatus', keyPath: 'status' }
			]
		}
	}
})

// Simple operations
await db.store('users').set({ id: 'u1', name: 'Alice', email: '[email protected]', status: 'active' })
const user = await db.store('users').get('u1')       // User | undefined
const user2 = await db.store('users').resolve('u1')  // User (throws if missing)

// Batch operations (single transaction)
await db.store('users').set([user1, user2, user3])

// Query builder
const active = await db.store('users').query()
	.where('status').equals('active')
	.limit(10)
	.toArray()

// Need native access? It's there.
const nativeDb = db.native

Documentation

  • API Guide — Comprehensive usage documentation

Development

# Install dependencies
npm install

# Run type checking
npm run check

# Run linting with autofix
npm run format

# Run tests
npm test

# Build package
npm run build

# Run showcase
npm run dev

Comparison

| Feature | This Library | Dexie.js | idb | |------------------|----------------------|--------------------|------------| | Type safety | ✅ Generic schemas | ⚠️ Limited | ⚠️ Limited | | Native access | ✅ .native | ❌ Hidden | ⚠️ Exposed | | Query builder | ✅ IDBKeyRange based | ⚠️ Over-abstracted | ❌ None | | Auto batching | ✅ Yes | ✅ Yes | ❌ No | | Cross-tab sync | ✅ BroadcastChannel | ⚠️ Custom | ❌ No | | Bundle size (gz) | ~11KB | ~30KB | ~1KB | | Dependencies | 1 (core) | 0 | 0 |

Note: This library provides more features than idb (query builder, batching, cross-tab sync) while remaining smaller than Dexie.js. The full bundle is ~56KB (~11KB gzipped).

License

MIT © Mike Garcia