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

@whoisjson/whoisjson

v1.0.4

Published

A Node.js wrapper for the WhoisJSON API - Get WHOIS information in JSON format

Readme

WhoisJson NPM Package

A Node.js wrapper for the WhoisJSON API - Get WHOIS, DNS, and SSL certificate information in JSON format.

Free accounts include 1000 requests per month. Check out our full documentation for more details about our API.

Installation

npm i @whoisjson/whoisjson

Usage

First, sign up for a free API key to get started with 1000 monthly requests.

import { WhoisJson } from '@whoisjson/whoisjson';

// Initialize the client
const whois = new WhoisJson({
  apiKey: 'YOUR_API_KEY'
});

// Get WHOIS information for a domain
async function getDomainInfo() {
  try {
    // WHOIS lookup
    const whoisInfo = await whois.lookup('example.com');
    console.log('WHOIS Info:', whoisInfo);

    // DNS lookup
    const dnsInfo = await whois.nslookup('example.com');
    console.log('DNS Info:', dnsInfo);

    // SSL certificate info
    const sslInfo = await whois.ssl('example.com');
    console.log('SSL Info:', sslInfo);

    // Check domain availability
    const availabilityInfo = await whois.checkDomainAvailability('example.com');
    console.log('Domain Availability:', availabilityInfo);
  } catch (error) {
    console.error('Error:', error);
  }
}

Response Examples

Domain Availability Response

{
  domain: "example.com",
  available: true
}

WHOIS Lookup Response

{
  server: "gamma",
  name: "example.com",
  idnName: "example.com",
  status: [
    "clientDeleteProhibited",
    "clientTransferProhibited"
  ],
  nameserver: [
    "dns1.example.com",
    "dns2.example.com"
  ],
  ips: "93.184.216.34",
  created: "1995-08-14T04:00:00Z",
  changed: "2024-02-14T08:00:00Z",
  expires: "2025-08-13T04:00:00Z",
  registered: true,
  dnssec: "signedDelegation",
  whoisserver: "whois.example.com",
  contacts: {
    owner: [{
      handle: "REDACTED FOR PRIVACY",
      name: "REDACTED FOR PRIVACY",
      email: "REDACTED FOR PRIVACY",
      country: "US"
    }]
  },
  registrar: {
    id: "123",
    name: "Example Registrar, Inc.",
    email: "[email protected]",
    url: "https://example.com",
    phone: "+1.2345678900"
  }
}

NSLookup Response

{
  domain: "example.com",
  records: {
    a: ["93.184.216.34"],
    aaaa: ["2606:2800:220:1:248:1893:25c8:1946"],
    mx: [
      {
        priority: 10,
        exchange: "mail.example.com"
      }
    ],
    ns: [
      "ns1.example.com",
      "ns2.example.com"
    ],
    txt: ["v=spf1 include:_spf.example.com ~all"],
    soa: {
      mname: "ns1.example.com",
      rname: "hostmaster.example.com",
      serial: 2024021401,
      refresh: 7200,
      retry: 3600,
      expire: 1209600,
      minimum: 3600
    }
  }
}

SSL Certificate Response

{
  domain: "example.com",
  valid: true,
  issuer: {
    organization: "Let's Encrypt",
    commonName: "R3",
    countryName: "US"
  },
  subject: {
    commonName: "example.com"
  },
  validFrom: "2024-01-01T00:00:00Z",
  validTo: "2024-04-01T00:00:00Z",
  serialNumber: "123456789",
  version: 3,
  signatureAlgorithm: "SHA256withRSA",
  subjectAlternativeNames: [
    "example.com",
    "www.example.com"
  ]
}

API Reference

new WhoisJson(config)

Creates a new WhoisJson client instance.

Parameters

  • config (Object):
    • apiKey (string): Your WhoisJSON API key
    • baseUrl (string, optional): Custom API base URL

lookup(domain)

Get WHOIS information for a domain.

Parameters

  • domain (string): The domain name to lookup

Returns

Promise that resolves with the WHOIS information.

nslookup(domain)

Get DNS records for a domain.

Parameters

  • domain (string): The domain name to lookup

Returns

Promise that resolves with the DNS records information.

ssl(domain)

Get SSL certificate information for a domain.

Parameters

  • domain (string): The domain name to check

Returns

Promise that resolves with the SSL certificate information.

checkDomainAvailability(domain)

Check if a domain is available for registration.

Parameters

  • domain (string): The domain name to check

Returns

Promise that resolves with the domain availability information.

Error Handling

The package throws errors in the following cases:

  • Invalid API key
  • Invalid domain name
  • API rate limit exceeded
  • Network errors
  • Other API errors

License

MIT