You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

whois-api-js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

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
Source
npmnpm
Version published
Maintainers
1
Created
Source

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.

Keywords

whois

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.