Skip to content

w4andy/node-werist

Repository files navigation

node-werist

A whois client for node.js

Wer ist are the German words for who is

Build Status

Table of Contents

Installation

$ npm install werist

Usage

With Class

const Werist = require('werist').Werist;
const werist = new Werist(); 
werist.lookup('google.com', function(err, data) {
  console.log(data)
})

Without Class

const werist = require('werist')
werist.lookup('google.com', function(err, data) {
  console.log(data)
})

You may pass an object in between the address and the callback function to tweak the behavior of the lookup function:

{
  "server": null,   // this can be a string ("host:port"); leaving it empty then werist chooses the server 
  "follow": 2,      // number of times to follow redirects
  "timeout": 0,     // socket timeout, excluding this doesn't override any default timeout value
  "verbose": false, // setting this to true returns an array of responses from all servers
  "bind": null,     // bind the socket to a local IP address
  "proxy": {        // Socks Proxy
    "ipaddress": null,
    "port": 0,
    "type": 5       // or 4
  }
}

Credit

node-werist is inspired by rfc1036/whois and FurqanSoftware/node-whois