Skip to content

kozakvoj/node-ip-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node IP Tools

Discover information about an IP address.

The currently supported services are:

  • DNS (using pn/dns module)
  • ASN (using cymru and ipstoasn services)
  • GEO (using keycdn service)

Usage

const IpTools = require("@kozakvoj/node-ip-tools");
const ipTools = new IpTools.client();

const geo = IpTools.modules.geo;
const asn = IpTools.modules.asn;
const dns = IpTools.modules.dns;

ipTools
    .use(asn)
    .use(dns)
    .use(geo);

ipTools.run("188.247.240.199")
    .then(console.log);

Response:

{  
   "asn":{  
      "countryCode":"RO",
      "ASN":39737,
      "description":"NETVISION-AS"
   },
   "dns":{  
      "hostname":"199.240.247.188.primetelecom.ro",
      "service":"http"
   },
   "geo":{  
      "host":"188.247.240.199",
      "ip":"188.247.240.199",
      "rdns":"199.240.247.188.primetelecom.ro",
      "asn":39737,
      "isp":"Net Vision Telecom SRL",
      "country_name":"Romania",
      "country_code":"RO",
      "region_name":null,
      "region_code":null,
      "city":null,
      "postal_code":null,
      "continent_name":"Europe",
      "continent_code":"EU",
      "latitude":46,
      "longitude":25,
      "metro_code":null,
      "timezone":"Europe/Bucharest",
      "datetime":"2018-08-22 23:29:25"
   }
}

About

Discover information about an IP address.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published