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

skewcache

v0.8.0

Published

Mixes downlevel assets into your dist/ when deploying to Cloudflare.

Readme

Skewcache

Skewcache mixes downlevel assets into your dist/ when you deploy to Cloudflare Workers Static Assets, so that active client sessions from a previous deployment can still fetch delay-loaded JavaScript or similar static resources.

Install: npm install -D skewcache

You will also need Wrangler installed.

Usage

First, configure your bundler to put assets under a versioned path like /r.123/foo.js:

// vite.config.js
import { assetDir } from "skewcache";
import { defineConfig } from "vite";

const dir = assetDir(); // "r.123"

export default defineConfig(() => {
  return { build: { rolldownOptions: { output: {
    assetFileNames: `${dir}/[name][extname]`,
    chunkFileNames: `${dir}/[name].js`,
    entryFileNames: `${dir}/main.js`
  } } } };
});

The assetDir() helper generates a monotonic version number using git rev-list --count HEAD. (Note that a versioned path prefix means we don't need a content hash in the filename.)

Next, configure your _headers file so that browsers will cache those assets:

/r.:rev/*
  Cache-Control: public, max-age=31536000, immutable

Finally, hook Skewcache up to your package.json scripts like this:

{
  ...
  "scripts": {
    ...
    "predeploy": "skewcache predeploy",
    "deploy": "wrangler deploy",
    "postdeploy": "skewcache postdeploy"
  }
  ...
}

Two steps invoke Skewcache:

  • The predeploy command downloads a cache of assets from prior deployments and copies them into dist/, so that wrangler deploy sees the entire set.
  • The postdeploy command uploads a new cache that includes the deployment that just finished.

By default the cache is stored in R2 as skewcache/myproject. You can plug in your own storage backend through skewcache.config.js if you want to do something different.

Deployments more than a week old are discarded, so the cache doesn't grow unbounded. However, the previous deployment is always kept, regardless of age. The 1-week threshold can be configured.

The skewcache CLI looks for r.N asset dirs by default but can be configured to match any pattern. You can pass a custom format to assetDir() or roll your own. Versions don't have to be ordered, so you could e.g. use a SHA hash instead of a monotonic counter.

Configuration

You can customize skewcache with skewcache.config.js or any of the variations that cosmiconfig looks for.

// skewcache.config.js
export default {
  name: "myproject", // defaults to name from package.json
  bucket: "skewcache", // R2 bucket for the cache
  dist: "dist", // build output directory
  tmp: ".deploytmp", // temp working directory
  maxAge: { days: 7 }, // prune entries older than this, except the newest
  assetDir: /^r\.\d+$/, // regex matching the revision directory in `dist`
  storage: cfg => ({
    description: cfg.name,
    async get(file) { ... },
    async put(file) { ... }
  })
};

All of these except storage can also be specified as command-line flags (skewcache --help for details).