Workbox

Google's JavaScript libraries for building service workers and Progressive Web Apps

Library
npm
v7.4.1
13,031 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
89 /100 Excellent
Development Activity 88
Maintenance 92
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 86
Code Quality 84
Innovation 70
Learning Curve 72

Workbox is Google’s set of JavaScript libraries and build tools for adding production-grade service-worker behavior to a web app: precaching of build assets, runtime caching strategies (cache-first, network-first, stale-while-revalidate), request routing, background sync for offline form submissions, and broadcast update notifications when cached content changes. workbox-core is the shared module that every other Workbox package depends on for common state, logging, and cache-name configuration, making it the foundational package of the whole workbox-* family.

The monorepo ships both runtime libraries (workbox-precaching, workbox-routing, workbox-strategies, workbox-cacheable-response, workbox-expiration, workbox-background-sync, workbox-window, workbox-streams, workbox-navigation-preload, workbox-google-analytics, workbox-recipes) and build-time tooling (workbox-build, workbox-webpack-plugin, workbox-cli) that generates the service-worker file and precache manifest as part of a project’s build step. It has been the de facto standard for hand-rolled PWA service-worker logic since Google introduced it as the successor to sw-precache/sw-toolbox.

What You Get

  • Precaching (workbox-precaching) of build-time assets with automatic cache versioning based on file content hashes
  • Runtime caching strategies (workbox-strategies): cache-first, network-first, stale-while-revalidate, network-only, cache-only
  • Declarative request routing (workbox-routing) to match URL patterns or request types to specific caching strategies
  • Background sync (workbox-background-sync) for retrying failed POST/PUT requests once connectivity returns
  • Build integrations (workbox-webpack-plugin, workbox-build, workbox-cli) that generate the service worker and precache manifest without hand-writing cache-invalidation logic
  • workbox-window for coordinating service-worker lifecycle events (install, update, activation) from the main page thread

Common Use Cases

  • Adding offline support to a web app by precaching the built JS/CSS/HTML bundle and serving it from cache when the network is unavailable
  • Implementing a stale-while-revalidate strategy for API responses so the UI renders instantly from cache while a fresh copy loads in the background
  • Queuing failed form submissions or API writes via background sync so they retry automatically once the device reconnects
  • Generating a production-ready service worker as part of a webpack, Vite, or custom build pipeline via workbox-build/workbox-webpack-plugin instead of hand-writing cache-invalidation logic

Under The Hood

Architecture - The repository is a Lerna-managed monorepo (lerna.json) under packages/, with workbox-core at the center: it’s imported by nearly every other package for shared logging, cache-name prefixing, and plugin-callback conventions, while workbox-routing and workbox-strategies form the runtime request-handling pipeline (a Router maps matched requests to a Strategy instance, which composes with plugins like workbox-cacheable-response and workbox-expiration). Build-time packages (workbox-build, workbox-webpack-plugin, workbox-cli) are architecturally separate — they statically analyze a project’s build output and emit a generated service-worker file rather than running inside the service worker themselves. Tech Stack - Primarily JavaScript/TypeScript, built and tested via Gulp (gulpfile.js, gulp-tasks/) rather than a single unified bundler config, with ESLint configs split per-language (javascript.eslintrc.js, typescript.eslintrc.js) and Prettier for formatting. The infra/ directory holds shared build infrastructure used across all packages/* members. Code Quality - workbox-core’s own implementation is compact (~1,815 lines), reflecting its role as shared plumbing rather than feature logic; the wider repo has a dedicated test/ directory and CONTRIBUTING.md describing the PR/testing process expected for a Google-maintained web-platform library used across a large fraction of production PWAs. Google’s Aurora and Web DevRel teams are both credited as maintainers, indicating institutional rather than solo-maintainer ownership. API Design - A minimal service worker using Workbox is a handful of declarative calls (precacheAndRoute(self.__WB_MANIFEST), registerRoute(match, strategy)) rather than hand-written fetch event listeners with manual cache management, which is Workbox’s central value proposition — trading the Fetch/Cache API’s low-level flexibility for a much smaller amount of boilerplate to get correct, production-grade caching behavior.

Used by 27 apps in this directory

Vue
50%
GPL 3.0

IT-Tools

Developer Tools

40,954

A unified collection of 88 web-based developer utilities — from JSON formatting to subnet calculation — all self-hostable, keyboard-searchable, and offline-ready.

View details
60
Repo Health
74
Technical
63
Dependency
Built with
Vue 50%
TypeScript 48%
Updated 1 weeks ago
TypeScript
94%
AGPL 3.0

Laudspeaker

Automation · Marketing

2,629

Open-source customer engagement platform for building visual, event-triggered messaging journeys across email, SMS, push, in-app, and webhooks.

View details
45
Repo Health
66
Technical
62
Dependency
Built with
TypeScript 94%
Updated 3 months ago
Go
81%
GPL 3.0

Navidrome

File Storage · Music Audio

24,331

Run your own personal Spotify — stream your entire music collection from any device, anywhere, forever.

View details
91
Repo Health
81
Technical
66
Dependency
Built with
Go 81%
JavaScript 15%
Updated 6 days ago
TypeScript
97%
MIT

NewsNow

Bookmarks Archiving

22,143

Self-hostable news aggregator with an elegant column layout, GitHub OAuth, adaptive scraping intervals, and seamless Cloudflare D1 or SQLite persistence.

View details
75
Repo Health
74
Technical
70
Dependency
Built with
TypeScript 97%
Updated 2 weeks ago
TypeScript
85%
GPL 3.0

Notesnook

File Storage · Note Taking · Security

14,822

End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.

View details
91
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 85%
JavaScript 12%
Updated 5 days ago
TypeScript
85%
GPL 3.0

Notesnook

File Storage · Note Taking · Security

14,822

End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.

View details
91
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 85%
JavaScript 12%
Updated 5 days ago
TypeScript
85%
GPL 3.0

Notesnook

File Storage · Note Taking · Security

14,822

End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.

View details
91
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 85%
JavaScript 12%
Updated 5 days ago
TypeScript
85%
GPL 3.0

Notesnook

File Storage · Note Taking · Security

14,822

End-to-end encrypted, open-source note-taking where your data stays yours — even from the server.

View details
91
Repo Health
84
Technical
60
Dependency
Built with
TypeScript 85%
JavaScript 12%
Updated 5 days ago
TypeScript
90%
MIT

open-pencil

AI Design Tools · Design Tools

9,227

An open-source design editor that reads native Figma files, ships a built-in AI assistant with 100+ design tools, and offers real-time serverless collaboration — all without giving up your files.

View details
84
Repo Health
78
Technical
69
Dependency
Built with
TypeScript 90%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers