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

@swoff/cli

v0.3.13

Published

CLI for Swoff - Offline-first web apps made easy

Downloads

2,345

Readme

@swoff/cli

CLI for Swoff — offline-first web apps made easy.

Swoff generates a service worker and client-side utilities that give your web app server-state reactivity (stale-while-revalidate, auto-refetch, mutation tracking, dedup), offline support, and PWA features — zero runtime dependencies, all generated and auditable.

npx @swoff/cli init          # create swoff.config.json
npx @swoff/cli generate      # generate service worker + client files

Then import the single entry point:

import { initServiceWorker } from "swoff/client-injector.js";
initServiceWorker();

Features

| Category | Feature | | ---------------------- | --------------------------------------------------- | | Caching | 6 strategies | | Mutations | useState-style tracking, offline queue, concurrency | | Prefetching | Cache warming on hover/navigation | | Dependent queries | enabled option, nullable URL | | Query cancellation | AbortController integration | | Real-time invalidation | SSE / WebSocket push events | | Tag invalidation | URL-derived cache tags | | Auth | memory-only tokens, bearer/cookie/custom | | GraphQL | body-hash caching, auto-tags | | PWA | install prompt, manifest, SW update hooks | | Push notifications | VAPID subscription management | | Background Sync | process mutations after tab close | | Cross-tab sync | broadcast invalidation across tabs |

CLI Commands

| Command | Description | | ---------------- | ---------------------------------------------- | | init | Create swoff.config.json with auto-detection | | generate | Generate SW + all supporting files | | add <feature> | Enable a feature and regenerate | | validate | Validate swoff.config.json | | info [feature] | Show summary or per-feature details | | clean | Remove all generated files and config | | help [command] | Show help for a specific command |

For PWA asset generation (icons, splash screens, favicons, manifest.json), use the standalone @swoff/assets package:

npx @swoff/assets --source ./logo.svg

Configuration

Create swoff.config.json with swoff init, then tweak as needed. Full schema reference in docs/CONFIG.md.

API Reference

Read the API reference for detailed information on each API.

CLI Reference

Read the CLI reference for detailed information on each command.

Architecture

Read the architecture for detailed information on the project's architecture.

Comparison With Other Popular Tools

Read the comparison for a comprehensive comparison with popular tools.

Ecosystem

Read the ecosystem to see how swoff integrates with any web framework you can work with.


Requirements

  • Node.js >= 18
  • A build tool with a package.json build script
  • Secure Context (required for service workers)

License

MIT

Source: github.com/iamsuudi/swoff