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

@kyneta/indexeddb-store

v1.6.1

Published

IndexedDB storage backend for @kyneta/exchange — browser-side persistent storage

Downloads

2,317

Readme

@kyneta/indexeddb-store

IndexedDB storage backend for @kyneta/exchange — browser-side persistent storage for documents that survive page refreshes, tab crashes, and temporary network loss.

Implements the Store interface — pass directly to Exchange({ stores: [...] }) for automatic document persistence and hydration.

Install

pnpm add @kyneta/indexeddb-store

Quick Start

import { createIndexedDBStore } from "@kyneta/indexeddb-store"
import { Exchange, persistentPeerId } from "@kyneta/exchange"

const store = await createIndexedDBStore("my-app-db")
const exchange = new Exchange({
  id: persistentPeerId("my-peer-id"),
  stores: [store],
  transports: [...],
})

// Documents are automatically persisted on mutation and hydrated on restart.
const doc = exchange.get("my-doc", TodoDoc)

That's it. The Exchange handles hydration (loading from storage on get() / replicate()) and persistence (saving incremental deltas via onStateAdvanced) — no manual save/load needed.

Note the await on createIndexedDBStore — unlike the synchronous LevelDB factory, IndexedDB requires an async open before the store is ready.

API

createIndexedDBStore(dbName)

Async factory function that returns a Store. The dbName is the IndexedDB database name visible in browser DevTools.

import { createIndexedDBStore } from "@kyneta/indexeddb-store"

const store = await createIndexedDBStore("my-app-db")

IndexedDBStore

The class implementing the Store interface. Use createIndexedDBStore for most cases; use the class directly if you need access to close() outside of the Exchange lifecycle.

import { IndexedDBStore } from "@kyneta/indexeddb-store"

const store = await IndexedDBStore.open("my-app-db")

// ... use with Exchange ...

await store.close() // release the IDB connection

deleteIndexedDBStore(dbName)

Delete an IndexedDB database entirely. Useful for test cleanup and development resets. The database must not be open — call store.close() before deleting.

import { deleteIndexedDBStore } from "@kyneta/indexeddb-store"

await store.close()
await deleteIndexedDBStore("my-app-db")

Design

See TECHNICAL.md for details on the database schema, transaction semantics, and structured clone strategy.

Peer Dependencies

{
  "peerDependencies": {
    "@kyneta/exchange": "^1.3.1",
    "@kyneta/schema": "^1.3.1"
  }
}

License

MIT