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

@shapeshift-labs/frontier-state-cache-idb

v0.1.0

Published

IndexedDB persistence adapter for Frontier state-cache snapshots.

Readme

Frontier State Cache IndexedDB

IndexedDB persistence adapter for Frontier state-cache snapshots.

This package provides a browser IndexedDB storage adapter for @shapeshift-labs/frontier-state-cache. It lets applications keep using local in-memory query cache APIs while persisting cache snapshots across reloads.

Related Packages

Package source repositories:

Install

npm install @shapeshift-labs/frontier-state-cache @shapeshift-labs/frontier-state-cache-idb

Usage

import { createQueryCache, persistQueryCache } from '@shapeshift-labs/frontier-state-cache';
import { createQueryCacheIndexedDbStorageAdapter } from '@shapeshift-labs/frontier-state-cache-idb';

const cache = createQueryCache();
const storage = createQueryCacheIndexedDbStorageAdapter({
  databaseName: 'app-cache'
});

const persistence = persistQueryCache(cache, storage, {
  autoHydrate: true,
  debounceMs: 100
});

cache.writeQuery(['todos'], [
  { __typename: 'Todo', id: 't1', text: 'ship', done: false }
]);

await persistence.flush();

API

import {
  createQueryCacheIndexedDbStorageAdapter,
  type QueryCacheIndexedDbStorageAdapter,
  type QueryCacheIndexedDbStorageOptions
} from '@shapeshift-labs/frontier-state-cache-idb';

Core exports:

  • createQueryCacheIndexedDbStorageAdapter(options?) creates a QueryCacheStorageAdapter.
  • adapter.load() reads the current persisted cache snapshot.
  • adapter.save(snapshot) writes one structured snapshot record.
  • adapter.clear() removes the snapshot record.
  • adapter.close() closes the cached IDBDatabase handle.
  • adapter.destroy() closes and deletes the IndexedDB database.

Options:

  • databaseName: IndexedDB database name. Defaults to frontier-state-cache.
  • storeName: object store name. Defaults to snapshots.
  • snapshotKey: record key for the cache snapshot. Defaults to default.
  • version: IndexedDB database version. Defaults to 1.
  • indexedDB: explicit IDBFactory, useful for tests, workers, or alternate browser contexts.
  • onBlocked and onVersionChange: lifecycle hooks for upgrade/delete/version-change events.

Package Scope

This package owns only IndexedDB persistence for Frontier state-cache snapshots. It does not add a query cache runtime, mutation planner, CRDT sync provider, remote replication protocol, cross-tab broadcast layer, or arbitrary IndexedDB query abstraction.

Future package-local work may add durable change-log storage and cross-tab coordination, but those surfaces should stay opt-in and separate from the basic snapshot adapter.

TypeScript

The package ships ESM JavaScript plus .d.ts declarations. The package-local TypeScript source lives in src/ and compiles directly to dist/.

Validation

npm test
npm run fuzz
npm run bench
npm run pack:dry

Benchmarks

Run the package-local benchmark:

npm run bench

Latest local package benchmark on Node v26.1.0 with the package test IndexedDB shim, 3 rounds:

| Fixture | Median | p95 | | --- | ---: | ---: | | IDB snapshot save | 28,290 us | 30,774 us | | IDB snapshot load | 24,779 us | 25,180 us | | IDB persistence flush | 23,888 us | 29,805 us | | IDB snapshot clear | 2,397 us | 2,481 us |

These are Frontier-only package measurements, not competitor comparisons. Browser IndexedDB implementations will differ from the test shim.

License

MIT. See LICENSE.