Lightweight RDAP client for domain and IP lookups with normalized JSON output, built-in caching, and a user-friendly CLI. Works seamlessly in Node.js, browsers, and serverless environments.
🚀 Blazingly fast lookups powered by automatic IANA bootstrap discovery and retry logic.
🔗 Explore full API docs at: https://iocium.github.io/rdap-lite
npm install @iocium/rdap-lite
# or
yarn add @iocium/rdap-lite
# Simple lookup
npx rdap-lite example.com
# JSON output
npx rdap-lite 8.8.8.8 --json
For more options:
rdap-lite --help
import { queryRDAP } from '@iocium/rdap-lite';
(async () => {
try {
const info = await queryRDAP('example.com', {
timeout: 5000,
headers: { 'User-Agent': 'my-app/1.0' },
proxy: 'https://myproxy.local/',
});
console.log(info);
} catch (err) {
console.error('Error:', err);
}
})();
Option | Type | Default | Description |
---|---|---|---|
headers |
Record<string,string> |
{…} |
Custom HTTP headers |
proxy |
string |
undefined |
Proxy prefix URL for routing requests |
timeout |
number |
10000 |
Request timeout in milliseconds |
cache |
RDAPCache |
In-memory | Custom cache implementing .get() / .set() |
The default in-memory cache retains results for 1 hour.
You can use the default in-memory cache via the cache
option (using memoryCache
), or Workers KV and D1 backends with the built-in helpers:
import { queryRDAP, kvCache, d1Cache } from '@iocium/rdap-lite';
// Use KV namespace as cache
const result = await queryRDAP('example.com', {
cache: kvCache(env.MY_KV_NAMESPACE),
});
// Use D1 database as cache
const result2 = await queryRDAP('example.com', {
cache: d1Cache(env.DB),
});
We provide a standalone IIFE bundle for direct use in browsers (no bundler required):
<script src="dist/browser/index.global.js"></script>
<script>
rdapLite.queryRDAP('example.com').then(console.log);
</script>
Explore the full API reference generated via TypeDoc:
MIT