Registry / http-networking / node-rdap

node-rdap

JSON →
library0.5.0jsnpmunverified

Node RDAP is a client library designed for Node.js environments, providing an interface to the Registration Data Access Protocol (RDAP). It serves as a modern alternative to traditional Whois lookups, enabling developers to programmatically retrieve registration data for domains, IPv4 and IPv6 addresses, and Autonomous System Numbers (ASNs). The current stable version is 0.5.0, indicating it is under active development and may undergo further API refinements before reaching a 1.0 stable release. While a specific release cadence isn't explicitly published, pre-1.0 versions typically imply iterative updates. Its key differentiators include native support for modern Node.js (requiring Node.js >=20.19.0 or >=22.12.0), adherence to the RDAP standard, and the provision of distinct, type-safe functions for different lookup types (domain, IP, autnum). It ships with TypeScript types, enhancing the developer experience for statically typed projects, and is primarily intended for server-side use cases requiring public registration data.

npm install node-rdap
INSTALL
IMPORT
SIG · NODE-RDAP
N
node-rdap
http-networkingjavascriptv0.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

domain
import { domain } from 'node-rdap';
const { domain } = require('node-rdap');
Node RDAP is an ESM-first package. Use `import` syntax. Attempting to `require` will likely result in a TypeError.
ip
import { ip } from 'node-rdap';
import ip from 'node-rdap';
`ip` is a named export, not the default export. Destructure it from the package.
autnum
import { autnum } from 'node-rdap';
const autnum = require('node-rdap').autnum;
Ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json` or using `.mjs` extension) to correctly use `import`.

Demonstrates how to perform domain, IPv4, IPv6, and Autonomous System Number (ASN) RDAP lookups using the async/await pattern.

import { domain, ip, autnum } from 'node-rdap'; async function performRdapLookups() { try { console.log('--- Domain Lookup ---'); const githubDomainResult = await domain('github.com'); console.log('GitHub.com RDAP Data:', githubDomainResult); console.log('\n--- IPv4 Lookup ---'); const ipv4Result = await ip('140.82.121.4'); console.log('140.82.121.4 RDAP Data:', ipv4Result); console.log('\n--- IPv6 Lookup ---'); const ipv6Result = await ip('2a00:1450:4009:818::200e'); console.log('2a00:1450:4009:818::200e RDAP Data:', ipv6Result); console.log('\n--- Autnum Lookup ---'); const autnumResult = await autnum(1); console.log('ASN 1 RDAP Data:', autnumResult); } catch (error) { console.error('An error occurred during RDAP lookup:', error.message); // Log detailed error for debugging, but be mindful of sensitive information. if (error.response) { console.error('HTTP Status:', error.response.status); console.error('Response Data:', error.response.data); } } } performRdapLookups();
Debug
Known issues
breakingAs of version 0.5.0, this package is pre-1.0. The API may be subject to breaking changes without prior major version increments. Always review the changelog when updating.
fix
Refer to the official GitHub repository for the latest documentation and changelog before upgrading minor or patch versions.
affects: >=0.1.0
gotchaRDAP servers, like Whois, are subject to rate limiting and abuse prevention policies. Frequent queries from a single IP can result in temporary or permanent blocks.
fix
Implement proper caching mechanisms, introduce delays between successive queries, or integrate with a proxy service that handles rate limiting across multiple requests.
affects: >=0.1.0
gotchaRDAP responses can have inconsistent structures across different registrars and registries. Parsing the data might require conditional logic to handle variations in field names or nesting.
fix
Thoroughly inspect the structure of results from various TLDs and IP ranges. Implement robust error handling and null/undefined checks when accessing properties within the RDAP response object.
affects: >=0.1.0
gotchaThe package requires Node.js version `>=20.19.0 || >=22.12.0`. Using older Node.js versions will lead to runtime errors or module resolution failures.
fix
Upgrade your Node.js runtime to at least version 20.19.0 or 22.12.0 to meet the engine requirements.
affects: <20.19.0 || <22.12.0
Errors
Common errors & fixes
TypeError: (0 , node_rdap_1.domain) is not a function
Attempting to use `require()` CommonJS syntax in an environment where `node-rdap` is treated as an ESM module, or incorrect named import.
fix
Ensure your project uses ES modules (`import { domain } from 'node-rdap';`) and that your `package.json` specifies `"type": "module"` or files have `.mjs` extensions.
Error: connect ECONNREFUSED
The RDAP server could not be reached or actively refused the connection, often due to network issues, firewalls, or the server being offline.
fix
Verify network connectivity, check firewall rules, and ensure the target RDAP server is operational. This could also indicate rate limiting or IP blocking from the server side.
Error: Request timed out
The RDAP request took too long to receive a response from the server, indicating network latency or an unresponsive RDAP service.
fix
Increase the request timeout if possible (though the library might not expose this), or retry the request after a short delay. Investigate the health and responsiveness of the target RDAP server.
TypeError: Cannot read properties of undefined (reading 'handle')
An attempt was made to access a property on an `undefined` or `null` RDAP response object, likely because the lookup failed, or the expected data structure was not present.
fix
Add explicit checks for `null` or `undefined` before accessing properties of the RDAP lookup result. Wrap property access in `if` statements or use optional chaining (`?.`) to gracefully handle missing data.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
node-rdap — npm install node-rdap · libregistry