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

@kagal/acme

v0.1.1

Published

Platform-neutral ACME protocol library (RFC 8555)

Downloads

233

Readme

@kagal/acme

Platform-neutral ACME protocol library (RFC 8555). Protocol types, Valibot schemas, and WebCrypto-based utilities.

Sub-path Exports

Current

| Export | Description | Dependencies | |--------|-------------|--------------| | @kagal/acme/types | Interfaces, const tuples, ReadonlySet constants, branded Base64url / Base64urlAlphabet / PEM | none | | @kagal/acme/schema | Valibot validators | valibot | | @kagal/acme/utils | base64url codec, random bytes, JWK thumbprint, JWK export / parse | WebCrypto, jose, /schema | | @kagal/acme/client | Stub — no surface yet | none | | @kagal/acme/server | Stub — no surface yet | none |

Planned

| Export | Description | Dependencies | |--------|-------------|--------------| | @kagal/acme/utils | + CSR parsing, cert inspection, ARI cert ID, PEM helpers | + @peculiar/x509, pkijs | | @kagal/acme/client | + Client state machines | /schema, /utils | | @kagal/acme/server | + Server state machines | /schema, /utils |

Client and server will ship as resumable state machines with JSON-serialisable state and injected dependencies — the machine will own protocol logic, the consumer will own persistence, key material, and policy.

Sub-paths are layered by dependency weight — import the lightest layer you need:

types          zero deps, type-only contracts
  \
  schema       + valibot — structural validation
    \
    utils      + WebCrypto — decode, validate, verify
    / \
client  server   protocol state machines

/schema validators return the hand-written types from /types, not Valibot's inferred output. /utils uses /schema internally for the decode → validate → verify pipeline (parseJWK, exportJWK).

Encoding contracts cross the layer boundary as branded strings: @kagal/acme/types exports Base64url, Base64urlAlphabet, and PEM, and every /utils producer and /schema validator returns the brand. Base64urlAlphabet is the alphabet-only sibling of Base64url — used for Challenge.token (RFC 8555 §8.1), where the wire format constrains characters to the base64url alphabet but does not carry a byte-framed length. Plain string cannot be assigned to a branded slot — use a producer, a validator, or the unvalidated asBase64url / asBase64urlAlphabet / asPEM accessor at a trust boundary.

Type-only consumers add @kagal/acme as a devDependency and import from /types.

Usage

Types

import type {
  Order,
  OrderStatus,
} from '@kagal/acme/types';

// Runtime constants for validation checks
import { OrderStatuses } from '@kagal/acme/types';

if (OrderStatuses.has(raw)) {
  // raw is OrderStatus
}

Schema validation

import { validateOrder } from '@kagal/acme/schema';

const result = validateOrder(json);
if (result.success) {
  result.data.status;       // OrderStatus
  result.data.identifiers;  // Identifier[]
} else {
  result.issues;            // validation errors
}

Response object schemas use looseObject — unknown fields pass through for forward compatibility. Request payload schemas use strictObject — the client controls the structure. Decoded JWS headers use looseObject (headers allow additional parameters) with ACMERequestHeaderSchema enforcing the jwk XOR kid constraint.

Encoding

import {
  encodeBase64url,
  getRandom,
  jwkThumbprint,
} from '@kagal/acme/utils';

// Encode raw bytes to base64url (branded `Base64url`).
const sig = encodeBase64url(signatureBytes);

// Random token, base64url-encoded.
const nonce = getRandom(16);

// RFC 7638 SHA-256 JWK thumbprint — 43 chars.
const thumbprint = await jwkThumbprint(accountJWK);

Licence

MIT