https://github.com/prozi/offline-worker
service worker for PWA - use fresh then cache response
https://github.com/prozi/offline-worker
Last synced: 2 months ago
JSON representation
service worker for PWA - use fresh then cache response
- Host: GitHub
- URL: https://github.com/prozi/offline-worker
- Owner: Prozi
- License: mit
- Created: 2023-02-11T01:38:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-14T19:03:05.000Z (9 months ago)
- Last Synced: 2025-03-17T17:39:52.027Z (2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# offline-worker
## installation
```bash
$ npm i offline-worker --save-dev
$ cp node_modules/offline-worker/worker.js public
```where public is your public/static directory
then in your front-end code use:
```js
import register from 'offline-worker';register();
```## result
- your service worker makes your page run offline
- first getting fresh requests, and falling back on cache