GithubHelp home page GithubHelp logo

kryndex / sw-helpers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlechrome/workbox

0.0 1.0 0.0 2.9 MB

(Currently Work in Progress) Service Worker helper libraries.

Home Page: https://googlechrome.github.io/sw-helpers/

License: Apache License 2.0

Ruby 0.22% JavaScript 95.28% HTML 4.37% CSS 0.14%

sw-helpers's Introduction

Travis Build Status AppVeyor Build status Dependency Status Dev Dependency Status

SW-Helpers

Contents

Ways to Use the Libraries

Despite the number of modules in this package, there are a number of approaches to using these tools which many be used separately or together in any number of combinations.

  • Precaching, runtime caching and routing: Use sw-lib to quickly implement caching strategies or a route.
  • Build process: Generate a service worker or manifest in your build process using sw-build.
  • Command line: Generate a service worker or manifest from the command line.
  • Go beyond the basics: Implement more advanced capabilities and more sophisticated use cases using any of the other libraries, which are described below.

Setting Up

Each module is installed separately using the command line as listed below. To use a particular module:

  1. Install the module. For example:

    npm install --save-dev sw-lib

  2. Copy the module's JavaScript and map files to your serving directory.

    cp node_modules/sw-lib/build/* app/

  3. Import the modules to your service worker file. For example:

    importScripts('sw-lib.min.js');

The Libraries

All of the modules are described below. Each has an About page with basic usage instructions and a Demo directory with an example. The main page of the documentation is here.

sw-appcache-behavior

Build Status

A service worker implementation of the behavior defined in a page's App Cache manifest.

Install: npm install --save-dev sw-appcache-behavior

Learn More: AboutDemo Code

sw-background-sync-queue

Build Status

Queues failed requests and uses the Background Sync API to replay those requests at a later time when the network state has changed.

Install: npm install --save-dev sw-background-sync-queue

Learn More: AboutDemo Code

sw-broadcast-cache-update

Build Status

A helper library that uses the Broadcast Channel API to announce when two Response objects differ.

Install: npm install --save-dev sw-broadcast-cache-update

Learn More: AboutDemo Code

sw-build

Build Status

This module can be used to generate a file manifest or service worker, that can be used with sw-lib.

Install: npm install --save-dev sw-build

Learn More: AboutDemo Code

sw-cache-expiration

Build Status

This library is still a work in progress and is not functional.

Install: npm install --save-dev sw-cache-expiration

Learn More: AboutDemo Code

sw-cacheable-response

Build Status

This library takes a Response object and determines whether it's cacheable, based on a specific configuration.

Install: npm install --save-dev sw-cacheable-response

Learn More: AboutDemo Code

sw-cli

Build Status

A CLI tool to generate a service worker and a file manifest making use of the sw-lib module.

Install: npm install --global sw-cli

sw-lib

Build Status

A service worker library to make managing fetch requests and caching as easy as possible.

Install: npm install --save-dev sw-lib

Learn More: AboutDemo Code

sw-offline-google-analytics

Build Status

A service worker helper library to retry offline Google Analytics requests when a connection is available.

Install: npm install --save-dev sw-offline-google-analytics

Learn More: AboutDemo Code

sw-precaching

Build Status

This library is still a work in progress and is not functional.

Install: npm install --save-dev sw-precaching

Learn More: AboutDemo Code

sw-routing

Build Status

A service worker helper library to route request URLs to handlers.

Install: npm install --save-dev sw-routing

Learn More: AboutDemo Code

sw-runtime-caching

Build Status

A service worker helper library that implements various runtime caching strategies.

Install: npm install --save-dev sw-runtime-caching

Learn More: AboutDemo Code

External Contributions

Please read the guide to contributing prior to filing any pull requests.

License

Copyright 2016 Google, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

sw-helpers's People

Contributors

addyosmani avatar jeffposnick avatar jpmedley avatar philipwalton avatar prateekbh avatar samdutton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.