This package has been deprecated

Author message:

move to @the-/util-sw ( https://github.com/the-labo/the/tree/master/packages/util-sw#readme )

the-sw-util

2.3.0 • Public • Published

the-sw-util

Build Status npm Version JS Standard

Utility for service workers

Installation

$ npm install the-sw-util --save

Usage

'use strict'

const {appCache, cachingFetch} = require('the-sw-util')

async function tryExample () {

  self.addEventListener('fetch', (event) => {
    event.respondWith(
      async function () {
        const cache = await appCache('my-site', 'v1.0.0')
        return cachingFetch(cache, event.request)
      }()
    )
  })

}

tryExample().catch((err) => console.error(err))

API Guide

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i the-sw-util

Weekly Downloads

1

Version

2.3.0

License

MIT

Unpacked Size

68.7 kB

Total Files

36

Last publish

Collaborators

  • okunishinishi