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

snowurl

v1.1.1

Published

A strict, predictable URL builder for TypeScript. No magic. No ambiguity. No broken typings

Readme

snowurl

NPM Version NPM Downloads

Build Status codecov

snowurl

A strict, predictable URL builder for TypeScript. No magic. No ambiguity. No broken typings.

snowurl is a rule-based alternative to urlcat, designed to fix long-standing issues with ambiguous parameter resolution and unreliable TypeScript inference.

If you are tired of bugs caused by paths like :id.html, :name-doc+x, or mismatched runtime vs typing behavior — this library is for you.


Features

  • Strict parameter grammar: [A-Za-z0-9_]+
  • ✅ Parameters stop at the first invalid character
  • ✅ Extensions and suffixes are always literal
  • ✅ Runtime behavior === TypeScript types
  • ✅ Fail-fast with clear error messages
  • ✅ Supports CJS & ESM
  • ✅ Zero dependencies

Installation

npm install snowurl

Usage

import { url } from "snowurl";

url("/file/:hash.tar.gz", { hash: "abc" });
// => "/file/abc.tar.gz"

url("/:name-doc+x", { name: "snow" });
// => "/snow-doc+x"

Core Rule (Very Important)

Parameter grammar

:param
param := [A-Za-z0-9_]+
  • A parameter starts with :
  • Its name may contain only A–Z, a–z, 0–9, _
  • The parameter ends immediately when an invalid character is encountered
  • Everything after that is treated as literal text

There are no options to change this behavior.


API

See docs: API Docs


Examples

1. Literal suffixes (extensions, formats, versions)

url("/download/:file.zip", { file: "data" });
// => "/download/data.zip"

url("/v/:id@latest", { id: 123 });
// => "/v/123@latest"

2. Mixed characters after parameters

url("/:name-doc+x", { name: "abc" });
// => "abc-doc+x"

Here:

  • name is the parameter
  • -doc+x is always literal

Invalid Usage (Throws Errors)

Invalid parameter name

url("/:name-doc", {
  "name-doc": "x"
});

Error:

Unknown param "name-doc".
Only parameters matching [A-Za-z0-9_] are allowed.

Missing parameter

url("/user/:id", {});

Error:

Missing param "id"

Extra / unknown parameter

url("/user/:id", { id: 1, foo: "bar" });

Error:

Unknown param "foo"

Why snowurl instead of urlcat?

| | urlcat | snowurl | | -------------------- | ----------------------- | ----------------------- | | Parameter grammar | Ambiguous | Strict & explicit | | :id.html | May resolve incorrectly | Always resolves id | | TypeScript inference | Often mismatched | Matches runtime exactly | | Fail-fast errors | ❌ | ✅ | | Predictability | ❌ | ✅ |

snowurl does not guess your intent — it enforces correctness.


If your path is:

/:file.tar.gz

Then the parameter is always file. file.tar.gz is never considered a parameter name.


TypeScript Support

snowurl infers parameter names at compile time:

url("/:user_id/profile", {
  user_id: 123,   // ✅
  // userId: 123  // ❌ TypeScript error
});

This prevents an entire class of runtime bugs before your code runs.


When should you use snowurl?

  • REST / HTTP clients
  • SDKs
  • Internal tooling
  • Long-lived projects that value correctness
  • When urlcat has caused subtle or painful bugs

Changelog

See full release notes in CHANGELOG.md


License

MIT © Yuki Akai