npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@molecule/app-pwa-default

v1.0.2

Published

Default registerPWA() — periodic update checks, styled update banner with i18n labels, multi-tab reload coordination, focus-triggered SW update check, error recovery on fatal SW errors. Lifts 147 lines of byte-identical PWA wiring shipped by every flagshi

Readme

@molecule/app-pwa-default

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

@molecule/app-pwa-default — drop-in PWA service worker registration with update banner, multi-tab coordination, and i18n-localized labels.

Apps' src/pwa.ts shrinks from 147 lines to a 1-line re-export.

Quick Start

// src/pwa.ts is a 1-line re-export:
//   export { registerPWA } from '@molecule/app-pwa-default'
// then call it once at app startup (e.g. in main.tsx):
import { registerPWA } from '@molecule/app-pwa-default'

registerPWA()

Type

feature

Installation

npm install @molecule/app-pwa-default @molecule/app-i18n @molecule/app-logger vite-plugin-pwa

API

Functions

registerPWA()

Registers the service worker with full PWA lifecycle management:

  • Periodic update checks (every 5 minutes)
  • Styled update banner with Update button
  • Multi-tab coordination (all tabs reload when new SW activates)
  • Window focus notification to SW
  • Error recovery (unregister SW + reload on fatal errors)
function registerPWA(): void

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-i18n ^1.0.1
  • @molecule/app-logger ^1.0.1
  • vite-plugin-pwa ^0.20.0 || ^1.0.0

Runtime Dependencies

  • @molecule/app-i18n
  • @molecule/app-logger
  • vite-plugin-pwa

Vite-only: imports the virtual:pwa-register module that vite-plugin-pwa generates, so the VitePWA() plugin MUST be configured in vite.config.ts (molecule scaffolds do this) — without it the import does not resolve and the build fails. Not usable under other bundlers. Framework-agnostic at runtime: the update banner is plain DOM (no React), themed via the app's --color-surface/--color-border/--color-foreground/--color-success CSS variables. Banner labels use the pwa.update, pwa.updateAvailable, and pwa.updating keys from @molecule/app-locales-common — load that bond's translations before the banner can appear, or the raw keys are shown. Call registerPWA() exactly once at app startup; it is a no-op during SSR.