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

kikloper-domain-check

v0.1.0

Published

Domain registration and SSL certificate information

Readme

domain-check

Fetch SSL and domain expiry dates for a domain. One call, no monitoring.

A zero-dependency TypeScript library that reads a domain's SSL certificate dates and its registration (RDAP) dates. Pure input → output: no database, no state, no scheduling, no notifications. What you do with the result is up to you.

Install

npm install @kikloper/domain-check

Requires Node.js 20+. Ships as ESM only.

Usage

import { lookup } from "@kikloper/domain-check";

const result = await lookup("example.com");

console.log(result.ssl?.validTo);           // SSL certificate expiry
console.log(result.domainInfo?.expiresAt);  // domain registration expiry

lookup() never throws. If either the SSL or RDAP lookup fails, that field is null and the reason is recorded in errors — the other field is unaffected. So both fields need a null check:

const result = await lookup("example.com");

if (result.ssl) {
  console.log(`SSL expires ${result.ssl.validTo.toISOString()}`);
} else {
  console.warn(`SSL lookup failed: ${result.errors.ssl}`);
}

API

Main

| Export | Signature | Description | | --- | --- | --- | | lookup | (domain: string, opts?: LookupOptions) => Promise<LookupResult> | Runs SSL and RDAP lookups in parallel. Never throws. | | getSslInfo | (domain: string, opts?: SslLookupOptions) => Promise<SslInfo> | Fetches TLS certificate dates/issuer/subject. Throws on failure. | | getDomainInfo | (domain: string, opts?: DomainLookupOptions) => Promise<DomainInfo> | Fetches registrar/registration/expiry via RDAP. Throws on failure. |

Low-level (SSRF guard)

Exported so the guard can be reused independently. Most callers only need lookup().

| Export | Signature | Description | | --- | --- | --- | | normalizeDomain | (input: string) => string | Strips scheme/port/path/query, normalizes to a bare ASCII hostname. | | resolveAndValidate | (hostname: string) => Promise<string> | Resolves a hostname once and rejects private/reserved IPs. | | safeRequest | (url: string, opts?: SafeRequestOptions) => Promise<SafeResponse> | SSRF-safe HTTP(S) request with manually re-validated redirects. | | createPinnedAgent | (hostname: string, ip: string) => https.Agent | Builds an https.Agent pinned to an already-resolved IP. |

Types

SslInfo, DomainInfo, LookupResult, LookupOptions, SslLookupOptions, DomainLookupOptions, RequestOptions are all exported from the package root.

Registration data coverage

RDAP is the authoritative source for registration data, but coverage varies by registry. Some TLDs omit the expiry event entirely, so domainInfo.expiresAt can be null even when the lookup itself succeeded.

If you pass fallbackApiKey, the library falls back to a secondary WHOIS API when RDAP returns no expiry date:

const result = await lookup("example.com", {
  fallbackApiKey: process.env.WHOIS_API_KEY,
});

Without that option, no request is ever made to any third-party service — only the IANA bootstrap registry and the registry's own RDAP server.

Design notes

  • No runtime dependencies. Only node:tls, node:https, node:http, node:dns, node:net.
  • SSRF-safe by construction. DNS is resolved exactly once per hop and the connection is pinned to that resolved IP directly, closing the DNS-rebinding TOCTOU window that a "resolve, validate, then fetch (which resolves again)" guard leaves open. Every address returned for a hostname is validated, not just the first.
  • RDAP over WHOIS. Registration data comes from RDAP via the IANA bootstrap registry — a structured, machine-readable protocol, not screen-scraped WHOIS text.

Known limits

  • RDAP coverage varies by TLD; see above.
  • Certificate dates are read as presented. Expired or otherwise invalid certificates are reported rather than rejected — the goal is to read the dates, not to validate trust.
  • Bare IP addresses and single-label hosts (localhost, intranet) are rejected by design.
  • Only ports 80 and 443 are connectable, on every redirect hop.

More features

This package intentionally does one thing: pull certificate and registration expiry dates for a domain, once, on demand. It does not poll, persist, or alert you when something is about to expire.

If you want that part handled for you, Kikloper watches SSL certificates and domain expiry dates continuously and notifies you before they lapse.

License

MIT © Webicha LLC