Socket
Socket
Sign inDemoInstall

whois-api-js

Package Overview
Dependencies
109
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    whois-api-js

Whois API client for Node.js


Version published
Weekly downloads
2.7K
increased by26.21%
Maintainers
1
Install size
1.58 MB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 06 Feb 2022

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc