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

ghettocdn-helper

v1.2.1

Published

A programmatic client for resolving assets built with [`ghettocdn`](https://gitlab.com/its-astro/ghettocdn). Fetches your CDN's manifest and lets you resolve original asset names to their hashed, optimized output URLs.

Readme

ghettocdn-helper

A programmatic client for resolving assets built with ghettocdn. Fetches your CDN's manifest and lets you resolve original asset names to their hashed, optimized output URLs.


Installation

npm install ghettocdn-helper

Usage

import { GhettoCDN } from "ghettocdn-helper"

const cdn = await GhettoCDN.create("https://your-cdn.example.com")

// Single-format asset
cdn.asset("config/config.json")
// => "https://your-cdn.example.com/config/config.9c8d7e6f.json"

// Multi-format asset — pick a format
cdn.asset("image/logo.image", "webp")
// => "https://your-cdn.example.com/image/logo.a1b2c3d4.webp"

// Multi-format asset — get first available format
cdn.asset("image/logo.image")
// => "https://your-cdn.example.com/image/logo.a1b2c3d4.webp"

API

GhettoCDN.create(endpoint: string)

Fetches the manifest from {endpoint}/.ghettocdn/manifest.json and returns a GhettoCDN instance. This is the only way to construct an instance.

const cdn = await GhettoCDN.create("https://your-cdn.example.com")

cdn.asset(name: string, format?: string): string

Resolves an asset name to its CDN URL.

  • name — the asset key as it appears in the manifest (e.g. "image/logo.image", "config/config.json")
  • format — optional format to select for multi-format assets (e.g. "webp", "png")

If format is passed for a single-output asset, it is ignored with a console warning and the single URL is returned.

Throws if the asset name is not found in the manifest, or if the requested format is not available.


cdn.refetch()

Re-fetches the manifest from the CDN endpoint and updates the instance in place. Useful for long-running processes where the CDN may have been redeployed.

await cdn.refetch()

Manifest Format

ghettocdn-helper is designed to work with the manifest generated by ghettocdn. Asset keys follow the same conventions:

  • Multi-format assets (images, animations) use a generic type extension as their key (.image, .animation)
  • Single-format assets use their actual extension (.json, .yaml, .js, etc.)
{
  "image/logo.image": {
    "webp": "image/logo.a1b2c3d4.webp",
    "png": "image/logo.e5f6a7b8.png"
  },
  "config/config.json": "config/config.9c8d7e6f.json"
}

See the ghettocdn docs for more on how the manifest is generated.


License

BSD-3-Clause-Clear