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

dchk

v0.1.1

Published

UNIX-style domain availability checker (RDAP-first)

Downloads

26

Readme

dchk (domain availability check)

npm version npm downloads License: MIT Node.js Version

A fast, UNIX-style domain availability checker using the RDAP protocol.

Overview

dchk is a command-line tool for checking domain name availability using the Registration Data Access Protocol (RDAP). It provides clean, scriptable output with proper UNIX exit codes, making it perfect for automation and batch processing.

Features

  • RDAP Protocol: Uses modern RDAP instead of deprecated WHOIS
  • Authoritative Sources: Queries authoritative RDAP servers directly
  • Concurrent Processing: Check multiple domains simultaneously
  • UNIX-Style: Proper exit codes and clean output for scripting
  • Flexible Input: Command-line arguments or stdin pipeline
  • Detailed Output: Optional verbose mode with response times and sources
  • Timeout Handling: Configurable timeouts with graceful error handling

Installation

From npm

npm install -g dchk

Usage

Basic Usage

Check a single domain:

dchk example.com
# Output: available
# Exit code: 0 (available) or 1 (registered)

Check multiple domains:

dchk google.com facebook.com nonexistent123.com
# Output:
# google.com: registered
# facebook.com: registered
# nonexistent123.com: available

Verbose Output

Get detailed information with response times and sources:

dchk --verbose google.com facebook.com nonexistent123.com
# Output:
# DOMAIN       STATUS      TIME   SOURCE
# ────────────────────────────────────────────
# google.com   REGISTERED  634ms  rdap.verisign.com
# facebook.com REGISTERED  521ms  rdap.verisign.com
# nonexistent123.com     AVAILABLE   387ms  rdap.org

Stdin Input

Process domains from stdin:

echo "example.com" | dchk
cat domains.txt | dchk --verbose
echo "google.com facebook.com" | tr ' ' '\n' | dchk

Shell Scripting

Use exit codes for conditional logic:

if dchk mydomain.com; then
    echo "Domain is available!"
else
    echo "Domain is taken or error occurred"
fi

Command Line Options

Usage: dchk [options] [domains...]

UNIX-style domain availability checker (RDAP-first)

Arguments:
  domains                     domain names to check (also reads from stdin)

Options:
  -V, --version               output the version number
  -v, --verbose               enable verbose output with response times and sources
  -q, --quiet                 suppress non-error output
  -c, --concurrency <number>  maximum concurrent checks (default: "10")
  -t, --timeout <number>      request timeout in milliseconds (default: "5000")
  --no-fallback               disable authoritative RDAP fallback
  -h, --help                  display help for command

Exit Codes

Following UNIX conventions:

  • 0: Domain is available (success)
  • 1: Domain is registered (failure)
  • 2: Error occurred (invalid domain, network error, etc.)

Examples

Check Domain Availability

dchk example.com
# available (exit code 0)

dchk google.com  
# registered (exit code 1)

Batch Processing

# From file
cat domains.txt | dchk --verbose --concurrency 5

# From command line
dchk domain1.com domain2.com domain3.com --verbose

# Mixed with timeout
dchk --timeout 3000 --verbose example.com test.com

Automation Scripts

#!/bin/bash
# Check if domain is available before proceeding
if dchk "$1" >/dev/null 2>&1; then
    echo "Domain $1 is available - proceeding with registration"
    # registration logic here
else
    echo "Domain $1 is not available"
    exit 1
fi

Performance Testing

# Test with high concurrency
echo "google.com facebook.com twitter.com github.com" | \
tr ' ' '\n' | \
dchk --verbose --concurrency 10 --timeout 2000

Output Formats

Simple Mode (Default)

available
registered
unknown

Multiple Domains

domain1.com: available
domain2.com: registered
domain3.com: unknown

Verbose Mode

DOMAIN       STATUS      TIME   SOURCE
────────────────────────────────────────────
domain1.com  AVAILABLE   234ms  rdap.org
domain2.com  REGISTERED  456ms  rdap.verisign.com

RDAP Protocol

dchk uses the Registration Data Access Protocol (RDAP), the modern successor to WHOIS:

  • Structured Data: JSON responses instead of unstructured text
  • Standardized: Consistent format across registries
  • Authoritative: Queries official registry sources
  • Reliable: Better error handling and status codes

The tool automatically:

  1. Queries rdap.org as the primary source
  2. Falls back to authoritative RDAP servers via IANA bootstrap
  3. Follows HTTP redirects to reach the correct endpoints
  4. Handles rate limiting and timeout scenarios

Development

Requirements

  • Node.js >= 20.0.0
  • npm or yarn

Setup

git clone https://github.com/carlrannaberg/dchk.git
cd dchk
npm install

Build

npm run build        # Build for production
npm run build:watch  # Build and watch for changes

Testing

npm test                    # Run all tests
npm run test:unit          # Unit tests only
npm run test:integration   # Integration tests only
npm run test:e2e           # End-to-end tests only

Project Structure

├── cli/
│   ├── commands/          # Command implementations
│   ├── lib/               # Core RDAP functionality
│   ├── utils/             # Utility functions
│   └── types/             # TypeScript type definitions
├── tests/
│   ├── unit/              # Unit tests
│   ├── integration/       # Integration tests
│   └── e2e/               # End-to-end tests
└── dist/                  # Built output

Library Usage

dchk can also be used as a library:

import { checkDomain, isValidDomain } from 'dchk';

// Check single domain
const result = await checkDomain('example.com');
console.log(result.status); // 'available', 'registered', or 'unknown'

// Validate domain format
if (isValidDomain('example.com')) {
    // proceed with check
}

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass (npm test)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

License

MIT License - see LICENSE file for details.

Related Tools

  • whois - Traditional WHOIS client
  • dig - DNS lookup utility
  • nslookup - DNS query tool
  • host - DNS lookup utility

dchk complements these tools by providing modern RDAP-based domain availability checking with clean, automatable output.