A lightweight queue for service workers that buffers non-GET requests (POST, PUT, DELETE, etc.) and retries them when connectivity is restored. Current stable version is 1.0.103, released occasionally via commits to main. It leverages IndexedDB for persistent storage inside service workers and provides a simple API to queue and replay requests. Differentiates from similar libraries (like Workbox Background Sync) by being minimal, dependency-free, and focused purely on REST API calls.
npm install restful-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Intercepts non-GET fetch events, queues them if offline, and replays when online.
Use only within service worker (self.addEventListener('fetch', ...)).Implement custom retry logic or use a library like Workbox Background Sync.
Monitor quota usage or manually purge old requests using deleteQueue() if exposed.
Combine with Background Sync API for automatic replay when online.
Ensure code runs only inside a service worker file.
Use ES module import via <script type="module"> or import in service worker with 'import { ... } from "restful-queue";'.Ensure same-origin requests or configure CORS on the target server.
No dependency data recorded yet.