Socket
Book a DemoInstallSign in
Socket

fly-precache

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fly-precache

Generate a service worker to cache resources and make them available offline.

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
2
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

fly-precache

Generate a service worker to cache resources and make them available offline.

Install

npm install --save-dev fly-precache

API

.precache(options)

A full list of sw-precache options can be found here.

Usage

Cache assets within the dist directory. This will create a dist/sw directory that contains two dependencies for the dist/service-worker.js.

exports.cache = function * (fly) {
  yield fly.source('dist/**/*.{js,html,css,png,jpg,gif}')
    .precache({
      cacheId: 'my-project-name'
    })
    .target('dist');
}

License

MIT © Luke Edwards

Keywords

fly

FAQs

Package last updated on 31 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts