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

@small-web/x509

v1.1.0

Published

Creates X.509 certificates and certification requests as used by Auto Encrypt and Auto Encrypt Localhost.

Readme

@small-web/x509

Constructs the X.509 certificates and certification requests used by Auto Encrypt and Auto Encrypt Localhost, in 100% JavaScript with no dependencies.

This module fills in the gaps in node:crypto (specifically, crypto.X509Certificate) that we need for those two projects.

Scope

  • Certificates (RFC 5280): Handles self-signed root certificate authority and server certificate creation (with basicConstraints, keyUsage, subjectKeyIdentifier, authorityKeyIdentifier, extendedKeyUsage and subjectAlternativeName).

  • Certification requests (RFC 2986 / PKCS#10): Subject alternative names for domains and IPv4/IPv6 addresses, encoded per RFC 8555 § 7.4.

  • Authority Key Identifier reader: Reads the Authority Key Identifier field using the Object Identifier (OID). Node does not expose this identifier and it is required per RFC 9773 § 4.1 for the ACME renewal information CertID.

Everything else we need – key generation, PEM keys, signing, and reading a certificate’s subject, issuer, serial number, alternative names and validity – is provided by node:crypto and should be used from there.

This is not a general-purpose module and it will likely have little use beyond its use in the two above-mentioned modules. If we had a monorepo, it would be in there and not published separately.

API

  • createCertificate(): Issues self-signed authority certificates and server certificates.

  • certificationRequest(): Builds a PKCS#10 request (RFC 2986) for an ACME order as per RFC 8555 § 7.4.

  • extensionValue(): Read an extension value out of a certificate without needing a general ASN.1 decoder.

  • authorityKeyIdentifier(): Returns the certificate’s Authority Key Identifier.

  • serialNumber(): Returns a certificate’s byte-encoded serial number, without the tag and length. This serial number can then be base64url-encoded as per RFC 9773 § 4.1 into an ARI certificate identifier.

  • subjectName(): Returns a certificate’s subject in its original encoding, including the header.

  • pem(), absent and OID: Encodings and identifiers used by Auto Encrypt and Auto Encrypt Localhost.

Regression testing

Prior to this module, we were using @panva/asn1.js and an inlined RFC 5280 decoder. The former is now a dev dependency and the latter a test helper that we use in regression testing to ensure the refactor did not introduce any behaviour changes.

Specifically:

  • Certification requests are asserted to be byte-identical with the encoding Auto Encrypt used previously.

  • The Authority Key Identifier reader tested against the old RFC 5280 decoder on all roots in the system trust store.

  • Key identifiers are compared against the SHA-1 hash derived by the RFC 5280 decoder.

Certificates are also inspected with crypto.X509Certificate and used for real TLS handshakes.

Licence

AGPL version 3.0.

Copyright ⓒ 2026-present Aral Balkan, Small Technology Foundation.