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

http-message-sig

v0.3.0

Published

HTTP Message Signatures defined by RFC 9421

Readme

http-message-sig

Core RFC 9421 HTTP Message Signatures for TypeScript.

Capabilities

| Capability | Support | | ------------------------------------------ | -------------------------------------------------------------------------------------------------- | | Native Request and Response | Yes, using Fetch-observable values | | Final request/response descriptors | Yes, with ordered field occurrences and optional trailers | | Related request components (req) | Yes, on response descriptors | | Ordinary field components | Yes | | Structured Field dictionary member (key) | Yes, strict RFC 8941 parsing | | Derived components | @method, @target-uri, @authority, @scheme, @request-target, @path, @query, @status | | Multiple signatures | Yes | | Async signing and verification | Yes | | Synchronous signing | Yes | | Explicit verification policy | Required | | WebCrypto providers | Ed25519 and RSA-PSS with SHA-512 |

Signing

import { appendSignature, createSignature } from "http-message-sig";

const fields = await createSignature(request, {
  label: "sig1",
  components: ["@method", "@authority", "@path", "content-digest"],
  parameters: { created: 1_700_000_000, alg: signer.algorithm, keyid: "key-1" },
  signer,
});

const headers = appendSignature(request.headers, fields);

Signers consume UTF-8 signature-base bytes and expose readonly algorithm. appendSignature accepts Headers only, returns a clone, and atomically parses and merges both signature dictionaries.

Use component("example-dict", { key: "member" }) for parameterized components. componentIdentity returns the exact serialized component identifier.

Verification

import { verifySignature } from "http-message-sig";

const verified = await verifySignature(request, {
  policy: {
    algorithms: ["ed25519"],
    requiredComponents: ["@method", "@authority", "@path"],
    requiredParameters: ["created", "keyid"],
    maxAge: 300,
    clockSkew: 5,
  },
  resolveVerifier(untrustedCandidate, context) {
    return lookupVerifier(untrustedCandidate.parameters.keyid, context);
  },
});

The resolver candidate is untrusted until cryptographic verification succeeds. The optional policy validate callback receives authenticated data and runs only after successful cryptographic verification.

Limitations

  • sf, bs, tr, @query-param, and unknown derived components are rejected with UnsupportedFeature.
  • RFC 9651 dates and display strings are rejected in signature fields. Signature metadata is limited to RFC 8941 bare items.
  • Fetch does not expose raw field occurrences or trailers. Use descriptors when those values matter.
  • Response has no related request. Use a response descriptor for req.
  • Cryptographic algorithms and key discovery are supplied by the caller.
  • The former directory helpers and draft-era signatureHeaders, verify, and RequestLike APIs were removed. Directory behavior belongs in the consuming package and must migrate to createSignature plus appendSignature.

Errors

Library validation failures use SignatureError, stable SignatureErrorCode values, and isSignatureError.

Security

This software has not been audited. Applications must define policy appropriate to their protocol, including algorithm, component, parameter, and freshness requirements.

License

Apache-2.0.