bun-storage is a zero-dependency ponyfill for the Web Storage API that uses SQLite to persist data. Version 2.0.5 is the current stable release, maintained as a fast Bun-native alternative to node-localstorage or memory-based implementations. It supports localStorage, sessionStorage, storage events, and optional quota enforcement. Compatible with Bun ≥1.0 and Node ≥20. Released via both npm and JSR, with automatic global injection via 'bun-storage/auto'. It differs from other storage libraries by targeting the Bun runtime, using SQLite for reliable persistence, and exposing both class-based and factory APIs.
npm install bun-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating storage instances, basic get/set, and listening for storage events using the factory function.
Use explicit createStorage() with a writable path or ':memory:' instead of auto-import.
Provide an instance of EventEmitter in the options when constructing Storage.
Use only with Bun runtime (>=1.0.0). If Node.js is required, consider @idleberg/local-storage instead.
import { createStorage } from 'bun-storage'Add import 'bun-storage/auto' at the top of your entry file.
Use ':memory:' or provide a writable path.
No dependency data recorded yet.