🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

whois-api-js

Whois API client for Node.js

1.0.0
latest
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created

whois-api-js licence whois-api-js release whois-api-js build

Overview

Node.js client library for Whois API.

Minimum Node.js version is 10.

Installation

The library is distributed via npm

npm install whois-api-js

Examples

Full API documentation available here

Create a new client

const WhoisApi = require('whois-api-js')

const client = new WhoisApi.Client('Your API Key')

Make basic requests

client.get('example.com')
  .then(function (data) {
    console.log(data)
  })
  .catch(function (error) {
    console.log(error)
  })

Additional parameters

// Check domain availability, fetch Whois proxy data & skip raw text
const params = new WhoisApi.RequestParameters({
  da: 1,
  checkProxyData: 1,
  ignoreRawTexts: 1
})

// Fetch results in XML
client.getRaw('example.com', WhoisApi.XML_FORMAT, params)
  .then(function (data) {
    console.log(data)
  })
  .catch(function (error) {
    console.log(error)
  })

Using callback

client.get('example.com', params, function (err, res) {
  if (err) {
    console.log(err)
  } else {
    console.log(res)
  }
})

Changelog

1.0.0: 02-07-2022

  • First release.

FAQs

Package last updated on 06 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts