Workbox

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

Library
npm
v7.4.1
13,024 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
86 /100 Excellent
Development Activity 76
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

TypeScript
95%
MIT

Actual

Invoicing Finance

29,186

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
73
Dependency
Built with
TypeScript 95%
Updated 4 days ago
TypeScript
68%
Apache 2.0

Appsmith

Automation · Developer Tools · No Code Platforms

40,959

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
93
Repo Health
79
Technical
66
Dependency
Built with
TypeScript 68%
Java 21%
Updated 6 days ago
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

11,049

A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.

View details
75
Repo Health
69
Technical
63
Dependency
Built with
TypeScript 92%
Updated 1 months ago
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,650

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
67
Repo Health
76
Technical
62
Dependency
Built with
JavaScript 90%
Updated 3 weeks ago
Python
47%
MIT

Docs

CMS · File Storage

16,868

Open-source collaborative knowledge platform with real-time editing, AI writing tools, and full self-hosting control — built by the French and German governments.

View details
88
Repo Health
81
Technical
68
Dependency
Built with
Python 47%
TypeScript 45%
Updated 4 days ago
TypeScript
92%
MIT

GB Studio

Design Tools · Developer Tools · Game Development

9,407

Drag-and-drop retro Game Boy game creator that compiles real ROMs — no coding required.

View details
88
Repo Health
83
Technical
73
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
TypeScript
67%
MIT

Hoppscotch

Developer Tools

80,529

A lightweight, offline-capable API development ecosystem for testing HTTP, GraphQL, WebSocket, MQTT, and SSE endpoints across web, desktop, and CLI.

View details
91
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 67%
Vue 25%
Updated 6 days ago
Python
74%
GPL 3.0

Frappe HR

Human Resources

8,831

Complete open-source HRMS for employee lifecycle, attendance, payroll, and performance — built on Frappe Framework with a mobile PWA.

View details
93
Repo Health
70
Technical
78
Dependency
Built with
Python 74%
JavaScript 15%
Updated 5 days ago
Python
74%
GPL 3.0

Frappe HR

Human Resources

8,831

Complete open-source HRMS for employee lifecycle, attendance, payroll, and performance — built on Frappe Framework with a mobile PWA.

View details
93
Repo Health
70
Technical
78
Dependency
Built with
Python 74%
JavaScript 15%
Updated 5 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