ip_details
v0.1.5
Published
Get all (almost) details of a particular IP address
Downloads
5
Readme
IP Address Details
Get all (almost) details of a particular IP address
Installation
npm install ip_details
Usage
var ipDetails = require('@pavanvamsi/ip_details');
ipDetails.getIp(function(ipAddress) {
console.log(ipAddress) // Your IP Address
});
ipDetails.isValidIp('127.0.0.1'); // return true or false
ipDetails.getCity('8.8.8.8', function(city) {
console.log(city); // Mountain View, California
});
ipDetails.getCountry('8.8.8.8', function(country) {
console.log(country); // United States
});
ipDetails.getCountry('8.88.8', function(country) {
console.log(country); // returns undefined because of invalid ip address
});
Tests
npm test
Like it? :see_no_evil:
:star: the repo and share.
To do
- Location (City, Country)
- Pincode
- Lat Long
- Org
License
MIT Copyright (c) pavanvamsi
Powered by - http://ip-api.com