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

@hyperjump/uri

v2.0.2

Published

A small and fast library for validating, parsing, and resolving URIs and IRIs

Readme

Hyperjump - URI

Validate, parse, resolve, and normalize URIs (RFC 3986) and IRIs (RFC 3987). An IRI is a URI that can have Unicode characters, like https://example.com/café.

Read the documentation at hyperjump.io

npm install @hyperjump/uri
import {
  assertAbsoluteIri, isIriReference, normalizeIri, resolveIri,
  toRelativeIri
} from "@hyperjump/uri";

const base = "https://example.com/schemas/person.json";
assertAbsoluteIri(base);

const reference = "address.json#/$defs/city";
if (!isIriReference(reference)) {
  throw Error(`Not a reference: ${reference}`);
}

const address = resolveIri(reference, base);
// "https://example.com/schemas/address.json#/$defs/city"

toRelativeIri(normalizeIri(address), normalizeIri(base));
// "address.json#/$defs/city"
  • Checked once. The validation functions check an identifier and its scheme's rules. The other functions trust what they're given, so you don't pay for checking the same identifier again. TypeScript types mark the strings that a validation function checked.
  • Scheme rules. It knows the rules of http, https, file, urn, tag, did, and data, and checks other schemes with the generic syntax.
  • Resolve and relativize. resolveIri resolves a reference against a base, and toRelativeIri finds the shortest reference from a base.
  • Normalize. Equivalent identifiers normalize to the same string, so you can compare them with ===.
  • Small and fast. No dependencies. TypeScript types included. Works in Node.js and browsers.

Documentation

The documentation is at hyperjump.io/uri.

  • Install: setup for Node.js, browsers, and TypeScript
  • Validate and parse: the kinds of identifier, checking them, and their components
  • Schemes: the rules of each built-in scheme, and how the package checks other schemes
  • Resolve references: resolveIri, toRelativeIri, and toAbsoluteIri
  • Normalize: comparing identifiers, and encoding fragments
  • Convert URLs: making a URL from Node.js or a browser an IRI
  • Performance: getting the most from the package, and what costs more than usual
  • Migrate from v1: what changed, and what to do about it

Using v1? See the v1 README.

Contributing

See design/ for how it works and why. The documentation's source is in website/.

npm install
npm test
npm run lint
npm run type-check

License

MIT