A lightweight library providing a localStorage-like API for use within Service Workers. Current stable version is 0.1.0. It offers simple asynchronous get/set operations backed by IndexedDB, with support for versioned storage instances. Unlike directly using the Cache API or IndexedDB, it provides a familiar synchronous-style interface (though methods return Promises) and automatic key management. Minimal dependencies; suitable for small projects needing persistent storage in Service Workers.
npm install serviceworker-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a versioned storage instance, sets and retrieves an object, checks length, gets a key by index, removes an item.
Use a consistent version number or implement manual migration.
Always use .then() or await when calling methods.
Create custom type declarations or use JSDoc.
Use `import ServiceWorkerStorage from 'serviceworker-storage'`.
Ensure all storage methods are awaited or chained with .then().
No dependency data recorded yet.