1.0.1 • Published 3 years ago
ipaddressapi v1.0.1
ipaddressapi
Usage
Add the package
To start, you will need to add the package. To do that, simply run npm i ipaddressapi
. In your code, add the following:
const ipaddressapi = require("ipaddressapi");
Now you can use any of the functions below!
API Usage
const ipaddressapi = require("ipaddressapi");
ipaddressapi.address().then(d => console.log(d)) // your ip is returned
ipaddressapi.isV4('127.0.0.1').then(d => console.log(d)) // true
ipaddressapi.isV6('::1').then(d => console.log(d)) // true
ipaddressapi.geo('127.0.0.1').then(d => console.log(d)) // null (because IP is localhost)
ipaddressapi.dns('127.0.0.1').then(d => console.log(d)) // null (because IP is localhost)
ipaddressapi.time('127.0.0.1').then(d => console.log(d)) // null (because IP is localhost)
ipaddressapi.currency('127.0.0.1').then(d => console.log(d)) // null (because IP is localhost)
ipaddressapi.whois('127.0.0.1').then(d => console.log(d)) // null (because IP is localhost)