jolle / whis

🕵️ A NodeJS WHOIS client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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`.

About

🕵️ A NodeJS WHOIS client

License:MIT License


Languages

Language:TypeScript 98.5%Language:JavaScript 1.5%