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

fast-url

v6.0.3

Published

A folk version of the `urlcat` library focus on performance and simplicity.

Readme

fast-url NPM Downloads JSR

A folk version of the urlcat focuses on performance and simplicity. Build correct URLs easily. A fast, minimal fork of urlcat focused on performance and simplicity.

Test codecov Quality Gate Status Bundle Size CodSpeed

fast-url is a tiny JavaScript/TypeScript library that makes building URLs convenient and prevents common mistakes.

Features

  • Lightweight: Only one dependency (fast-querystring) and minimal bundle size
  • Type safe: Written in TypeScript with full type definitions
  • URL safe: Automatically escapes parameters and handles edge cases
  • Unicode-aware: Uses codePointAt for proper Unicode handling, including graceful encoding of lone surrogates
  • Flexible: Multiple ways to build URLs for different use cases

Installation

# Using JSR (recommended for Deno)
deno add jsr:@hckhanh/fast-url

# Using bun
bun add fast-url

# Using npm
npm install fast-url

Usage

Basic usage example Basic usage example (dark mode)

Basic URL building

import { createUrl } from "fast-url";

// Path parameters
createUrl("https://api.example.com", "/users/:id", { id: 123 });
// → 'https://api.example.com/users/123'

// Query parameters
createUrl("https://api.example.com", "/users", { limit: 10, offset: 20 });
// → 'https://api.example.com/users?limit=10&offset=20'

// Combined path and query parameters
createUrl("https://api.example.com", "/users/:id/posts", { id: 123, limit: 10 });
// → 'https://api.example.com/users/123/posts?limit=10'

CommonJS

const { createUrl } = require("fast-url");

Utility functions

import { query, subst, join } from "fast-url";

// Build query strings
query({ name: "John", age: 30 });
// → 'name=John&age=30'

// Substitute path parameters
subst("/users/:id/posts/:postId", { id: 123, postId: 456 });
// → '/users/123/posts/456'

// Join URL parts
join("https://api.example.com/", "/", "/users");
// → 'https://api.example.com/users'

API

createUrl(baseUrl, pathTemplate, params?)

Build a complete URL by combining a base URL, path template, and parameters.

createUrl(baseTemplate, params)

Use a single template containing path parameters; unused params become query parameters.

query(params)

Build a query string from an object of key-value pairs.

subst(template, params)

Substitute path parameters in a template string.

join(part1, separator, part2)

Join two URL parts with exactly one separator.

Why fast-url?

Building URLs manually is error-prone:

// ❌ Error-prone manual approach
const url = `${baseUrl}/users/${id}/posts?limit=${limit}&offset=${offset}`;
// Issues: double slashes, unescaped parameters, complex concatenation
// ✅ Clean and safe with fast-url
const url = createUrl(baseUrl, "/users/:id/posts", { id, limit, offset });

fast-url handles:

  • Automatic parameter escaping
  • Proper URL segment joining
  • Clean separation of path and query parameters

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT