Giter Club home page Giter Club logo

whois-light's Introduction

Whois Light

whois-light is an extremely lightweight whois client, supporting hundreds of top-level-domains, using absolutely 0 packages.

Example

The following example will do a quick whois lookup for example.com and print the output.

const WhoisLight = require("whois-light");

// WhoisLight.lookup returns a native promise
WhoisLight.lookup("example.com")
  .then(function (whois) {
    // process raw whois information here
    console.log(whois);
  })
  .catch(console.error);

// Alternatively we can format the whois results from the server, and assort them into key values to easier process them.
// Please note that you may experience issues for duplicate keys, they will be overwritten.
WhoisLight.lookup({ format: true }, "example.com")
  .then(function (whois) {
    // process raw whois information here
    console.log("Domain name is, " + whois["Domain Name"]);
    console.log("Domain is due to expire, " + whois["Registry Expiry Date"]);

    // to access raw whois data from our formatted data, access the _raw key, for exmaple...
    // console.log(whois['_raw']);
  })
  .catch(console.error);

WhoisLight.lookup([options, ] name)

This function will do a simple whois lookup on a particular domain. See example for simple guide on this method.

[options ,]

Object

format - Whether or not you want to use the key/value formatting for returned whois data. See example. Default false, returns raw whois by default.

timeout - Socket timeout, measured in milliseconds. Default 5000

port - Whois underlying port. Default 43

name

Domain name to query

@returns

This function returns a promise. The resolve of this promise varies on the options.format. If this is set to true, the resolve will be a key/value object, otherwise the raw whois information.

WhoisLight.bulkLookup([options, ] names)

[options ,]

Object, this method implements the same options as WhoisLight.lookup options, with the addition of:

parellel - How many parellel workers will be fetching the whois queries.

names

This is an array of all the domains you wish to lookup. Has no limitations

@returns

A promise. The resolve of this promise resolves to an object. The keys of the object are domain names, and the values of the domain keys, depend on format. See above function for informaiton on format.

whois-light's People

Contributors

eithan1231 avatar phpb-com avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.