sw-helpers 0,1 eslint travis-ci npm

Service Worker helper libraries

Build Status

Service Worker Helpers

A collection of libraries that help enhance your existing service worker by providing commonly-needed functionality.

A monorepo approach is used to manage multiple helper libraries, each of which is versioned and published to npm independently.

The Libraries


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: AboutDemoAPI


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: AboutDemoAPI


Existing Build Tasks

Tasks are run via gulp, and assume that you have a globally installed gulp binary (npm install -g gulp) as well as a locally installed set of node_module dependencies (npm install from within the top-level directory).

When running a task, an optional --project=project-name parameter can be used. For example, gulp build:watch --project=sw-appcache-behavior. By default the task will be run against all projects.

New Projects

New projects should be created as sub-directories of projects, following the basic layout of the existing projects. It’s recommended that each library adopts the sw- prefix, for consistency.

Always include the following:

  • src/ - raw source files, with JSDoc-formatted comments.
  • build.js - Should export a function that performs all the steps needed to produce a ready-to-use library in local build/ directory.
  • test/*.js - One or more Mocha test suites.
  • package.json - The npm metadata for the library. Each library is versioned independently.

A demo/ directory is optional but encouraged. The project’s README.md file will be automatically generated based on a template using the metadata found in the JSDoc comments.

External Contributions

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


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


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.

Related Repositories



Service Worker helper libraries ...



The shopware CLI tools are your console helpers for all kind of shopware tasks ...



The shopware CLI tools are your console helpers for all kind of shopware tasks ...

Top Contributors

jeffposnick addyosmani philipwalton


package version
idb ^2.0.0
mkdirp ^0.5.1
update-notifier ^2.1.0
dev babel-preset-babili 0.0.12
chai ^4.0.2
chromedriver ^2.30.1
clear-require ^2.0.0
cookie-parser ^1.4.3
depcheck ^0.6.7
error-stack-parser ^2.0.1
eslint-config-google ^0.9.1
express ^4.14.0
fs-extra ^3.0.1
geckodriver 1.6.1
glob ^7.1.0
gulp ^3.9.1
gulp-compile-handlebars ^0.6.1
gulp-eslint ^4.0.0
gulp-insert ^0.5.0
gulp-rename ^1.2.2
gulp-spawn-mocha ^3.1.0
handlebars ^4.0.6
jsdoc-strip-async-await ^0.1.0
lerna 2.0.0-rc.5
minimist ^1.2.0
mockdate ^2.0.1
path-to-regexp ^1.6.0
promisify-node ^0.4.0
proxyquire ^1.7.10
rollup ^0.41.6
rollup-plugin-babel ^2.6.1
rollup-plugin-commonjs ^8.0.2
rollup-plugin-multi-entry ^2.0.1
rollup-plugin-node-resolve ^3.0.0
rollup-plugin-replace ^1.1.1
run-sequence ^1.2.2
selenium-assistant ^5.1.0
serve-index ^1.8.0
serve-static ^1.11.1
sinon ^2.2.0
sw-testing-helpers ^1.0.2
tmp 0.0.31
uppercamelcase ^3.0.0
webpack ^2.6.0


-   sw-offline-google-an zip tar
-   sw-offline-google-an zip tar
-   sw-offline-analytics zip tar