1.0.11 • Published 9 months ago

whois-wrapper v1.0.11

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
9 months ago

whois-wrapper

There are various nodejs whois clients. All of them do too many elaborated things but often fail to provide the same reliability of the CLI whois client.

This is not a whois client, this is just a wrapper around the whois client installed on your OS.

Only tested on mac and linux.

Prerequisites

You need whois. E.g.,apt-get install whois

Usage

import whois from "whois-wrapper";

whois({query: "181.64.132.0/24"})
    .then(console.log)
    .catch(console.log)

Answer:

[
  {
    "server": "whois.ripe.net",
    "data": [
      [
        {
          "key": "inetnum",
          "value": "83.231.214.0 - 83.231.214.255"
        },
        {
          "key": "netname",
          "value": "VERIO-DE-INFRA"
        },
        {
          "key": "country",
          "value": "DE"
        },
        {
          "key": "admin-c",
          "value": "NERA4-RIPE"
        },
        {
          "key": "remarks",
          "value": [
            "INFRA-AW",
            "Abuse/UCE:abuse@us.ntt.net",
            "Network:noc@us.ntt.net",
            "Security issues:security@us.ntt.net",
            "Geofeed https://geo.ip.gin.ntt.net/geofeeds/geofeeds.csv"
          ]
        },
        {
          "key": "descr",
          "value": [
            "NTTEO DE frankfurt facility"
          ]
        }
      ],
      [
        {
          "key": "role",
          "value": "NTT IP Addressing"
        },
        {
          "key": "address",
          "value": "5680 Greenwood Plaza Blvd."
        },
        {
          "key": "address",
          "value": "Greenwood Village, CO 80111"
        },
        {
          "key": "address",
          "value": "United States"
        }
      ]
    ]
  }
]

Options

OptionMeaningDefault
queryThe whois query. Read man whois for information. E.g., "r > 103.13.80.0/22"
flagThe flag to select the server. Usually s or h, depending on the os.
serversThe array of whois servers.All 5 RIRs
timeoutTimeout for the whois command.4000
fieldsAn array of whois fields (strings) you would like to receive. E.g., ["inetnum", "inet6num"]All fields
1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago