Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

service-workers

> 编程语言
Open source

A collection of utilities for creating/testing/experimenting with service workers.

1.3K stars0 likes1 views
WebsiteGitHub

About

A collection of utilities for creating/testing/experimenting with service workers.

*** THIS PROJECT IS NO LONGER MAINTAINED ***

Service Worker Toolchain

A collection of service worker generation tools. Configurable and forkable.

Includes the following packages

generate-service-worker

A node module for generating service worker files based on provided configuration options.

service-worker-plugin

A webpack plugin for generating dynamic service worker files and a runtime helper.

service-worker-mock

A mock service worker environment generator. Used for testing service worker code.

Why?

There are several other packages that generate service workers (sw-precache, offline-plugin, etc). This collection of tools was built to allow more complexity while being fully testable, and allowing the generation of multiple service worker files simultaneously for experimentation/rollout. We chose not to use a templating language, but to instead inject globals into the scripts so that our "templates" were pure JavaScript. This makes it easier to test/read/update the code, with the downside of slightly larger output sizes. See the README in each package for more details.

We encourage forking of the base templates found in packages/generate-service-worker/templates/.

Contributing

scripts description
yarn install install all dev dependencies
yarn test run the test suite
yarn run lint run eslint
yarn start run the demo for development testing

To get started contributing, run yarn start, which will run a webpack-devserver on localhost:3000. In demo/webpack.config.js you'll see the configurations used for the demo testing. Each experimental config can be accessed via the key query param (i.e. localhost:3000?key=withNotifications). This provides a simple way to install a new service worker for testing, and the corresponding generated code will be visible in the DOM itself thanks to highlight.js. Use the application tab in the devtools to verify that the service worker was installed. By setting debug: true in the plugin config, the devtools console can be used to verify actions are taking place.

Core Contributors

  • Zack Argyle
  • Yen-Wei Liu
  • Sebastian Herrlinger

Contributors ✌⊂(✰‿✰)つ✌

  • Doug Reeder
  • Jeff Posnick
  • Matt Gaunt
  • Joseph Liccini
  • Jonathan Creamer
  • Brad Erickson
  • Bryan Lee
  • Jamie King
  • Domingos Martins
  • André Naves
  • kontrollanten
  • cjies
  • sreedhard7
  • koenvg
  • pwwpche
  • jelly972

Some ideas for contributions:

  • Browserify plugin
  • Rollup plugin

License

MIT

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptservice-worker

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言