https://github.com/afeiship/next-offline-sw
Offline plugin for service worker runtime helper.
https://github.com/afeiship/next-offline-sw
cache next offline offline-plugin prefetch service-worker sw
Last synced: about 1 month ago
JSON representation
Offline plugin for service worker runtime helper.
- Host: GitHub
- URL: https://github.com/afeiship/next-offline-sw
- Owner: afeiship
- License: mit
- Created: 2019-05-12T03:44:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-01-05T05:34:20.000Z (over 2 years ago)
- Last Synced: 2025-03-21T23:03:52.590Z (about 1 year ago)
- Topics: cache, next, offline, offline-plugin, prefetch, service-worker, sw
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-offline-sw
> Offline plugin for service worker runtime helper.
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]
## installation
```bash
npm install -S @jswork/next-offline-sw
```
## apis
| api | params | description |
| ----------- | ------- | --------------------------------------------------------------------- |
| disabled | | You can implement it in your project(default: window.__SW_DISABLED__) |
| install | options | Install with sevice worker |
| uninstall | - | Remove all sevice worker |
| update | - | ApplyUpdate & delay refresh |
| applyUpdate | - | Apply new resource |
| refresh | - | Global.reload |
## usage
```js
import NxOfflineSw from '@jswork/next-offline-sw';
// code goes here:
NxOfflineSw.install();
```
## resources
- https://github.com/NekR/offline-plugin/blob/master/docs/updates.md
- https://stackoverflow.com/questions/33704791/how-do-i-uninstall-a-service-worker
## license
Code released under [the MIT license](https://github.com/afeiship/next-offline-sw/blob/master/LICENSE.txt).
[version-image]: https://img.shields.io/npm/v/@jswork/next-offline-sw
[version-url]: https://npmjs.org/package/@jswork/next-offline-sw
[license-image]: https://img.shields.io/npm/l/@jswork/next-offline-sw
[license-url]: https://github.com/afeiship/next-offline-sw/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-offline-sw
[size-url]: https://github.com/afeiship/next-offline-sw/blob/master/dist/next-offline-sw.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/next-offline-sw
[download-url]: https://www.npmjs.com/package/@jswork/next-offline-sw