Skip to content

jolle/whis

Repository files navigation

whis

A very simple and minimal WHOIS library. WHOIS server is got from whis-data which updates every month (from IANA). Please report issues like missing or incorrect WHOIS server data to the whis-data repository.

Usage

$ yarn add whis

(or npm install whis)

whis(domain: string, server?: string) ⇒ Promise<WhoisData>

getRaw(domain: string, server?: string) ⇒ Promise<string>

JavaScript (NodeJS)

const { whis } = require('whis');

whis('jolle.io').then(data => console.log(data));
const { getRaw } = require('whis');

getRaw('jolle.io').then(data => console.log(data)); // this will print the raw WHOIS response

TypeScript (and ES6+)

TypeScript typings are included automatically. You do not need to install typings manually from an external repository or with the @typings/* packages.

import whis from 'whis';

whis('jolle.io').then(data => console.log(data));
import { getRaw } from 'whis';

getRaw('jolle.io').then(data => console.log(data)); // this will print the raw WHOIS response

Advanced usage

import whis from 'whis';

whis('intranet-service.corporation', 'internal-whois.com').then(data =>
    console.log(data)
); // this will use the WHOIS server in "internal-whois.com" to get the data about `intranet-service.corporation`.