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

colab-asset-manager

v0.0.6

Published

Fingerprints a project's images and syncs them to a Bunny storage zone, writing the d8e-asset-manifest.json d8e reads.

Readme

colab-asset-manager

Fingerprints a project's images and syncs them to a Bunny storage zone, so images never live in git and never need uploading by hand. Writes d8e-asset-manifest.json, which d8e (1.2.0+) uses to point every reference at the CDN.

How it works

Run colab-asset-manager in a project root whenever you add, change or remove an image under src/asset/. It:

  1. Fingerprints each image from its content — asset/hero-banner.webp is stored as colab-asset-manager/hero-banner.3f2a9c1e.webp. Change the image and it gets a new name automatically, so it can be cached forever and a stale copy can never be served.
  2. Uploads the ones the storage zone doesn't have yet (checksum-verified).
  3. Writes d8e-asset-manifest.json: each image's path under src/ and its CDN URL. Commit this file — it's a few KB.
  4. Deletes files nobody references any more, 7 days after they stopped being referenced, so pages in browser caches, sent emails and older staging builds keep working in the meantime.

Code keeps referencing images normally (<img src="asset/hero-banner.webp">, url(../asset/hero-banner.webp)), so local dev still works by opening src/. At deploy, d8e rewrites those references to the CDN URLs and leaves the images out of dist/.

It only ever lists, uploads to and deletes inside the zone's colab-asset-manager/ folder — files uploaded by hand anywhere else in the zone are never touched. Supported: avif, gif, jpeg, jpg, png, svg, webp.

It runs on your machine only, never at deploy: the storage key stays off Heroku and Vercel, and staging can't delete production's images.

Setup

1. Install

npm install -g colab-asset-manager@latest

2. Add colab-asset-manager.json to the project root

{
  "storageZone": "viking-gear",
  "storageHost": "jh.storage.bunnycdn.com",
  "cdnUrl": "https://viking-gear-pz.b-cdn.net"
}
  • storageZone: the storage zone's name.
  • storageHost: optional, defaults to storage.bunnycdn.com (Frankfurt). Use the zone's primary region: uk., ny., la., sg., se., br., jh. (Johannesburg) or syd.storage.bunnycdn.com.
  • cdnUrl: the pull zone connected to that storage zone.

3. Gitignore the images

src/asset/**/*.avif
src/asset/**/*.gif
src/asset/**/*.jpeg
src/asset/**/*.jpg
src/asset/**/*.png
src/asset/**/*.svg
src/asset/**/*.webp

If the images are already committed, also run git rm -r --cached src/asset once (it keeps your local copies). Their old versions stay in git history.

4. Set the storage key

BUNNY_STORAGE_KEY is the storage zone password: Bunny dashboard → Storage → your zone → FTP & API Access. Keep it in your shell profile or a password manager — never in the repo.

Usage

colab-asset-manager --help      # lists every flag
colab-asset-manager --pull      # downloads the images the manifest lists into src/asset/ (no key needed)
colab-asset-manager --dry-run   # shows what would be uploaded and deleted; changes nothing
colab-asset-manager             # syncs and writes d8e-asset-manifest.json

The version is printed first, so you can tell which install is running.

Changing an image

  1. Fresh clone? Run colab-asset-manager --pull first — images aren't in git, so src/asset/ starts empty.
  2. Replace, add or remove the file in src/asset/ (kebab-case names). Keeping the same name for a replacement is fine: the fingerprint changes anyway. Check it locally by opening src/.
  3. colab-asset-manager --dry-run, then colab-asset-manager.
  4. Commit d8e-asset-manifest.json (plus any code change that references a new image) and deploy as usual.

If two people sync on different branches, d8e-asset-manifest.json conflicts on merge: pull both sets of images into src/asset/ (--pull) and run colab-asset-manager again — it rebuilds the manifest from what's there.

Safety checks

  • Nothing is deleted just because it's missing locally. If images the manifest lists aren't in src/asset/ (a fresh clone, a half-copied folder), syncing refuses and says to --pull. If you removed them on purpose, add --allow-removals.
  • --pull never overwrites a local file that differs from Bunny — that's usually a change that hasn't been uploaded yet. It only fills in missing ones, and checks each download against its fingerprint.
  • Deletions only happen inside the zone's colab-asset-manager/ folder, 7 days after a file stopped being referenced.

Limitations

  • Bunny storage zones have one full-access password (plus a read-only one, which isn't enough to upload). Anyone who uploads needs the full one: share it through a password manager, and regenerate it in Bunny if someone leaves.
  • Videos and other large files stay where they are (Mux / Bunny Stream).

Tests

npm test — Node's built-in test runner, no extra dependency. test/colab-asset-manager.test.js runs the real CLI against fixture projects and a fake Bunny (test/fake-bunny.js, installed as the global fetch), so nothing reaches the network and no key is needed.

Deploying to npm

  1. FIRST TIME ONLY: run npm login
  2. Bump the version in package.json
  3. npm test
  4. Run npm publish