New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-iplocate

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-iplocate

Find geolocation data from IP addresses (e.g. city, country, timezone) using the IPLocate.io API

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
623
increased by4.36%
Maintainers
1
Weekly downloads
 
Created
Source

IPLocate for Node.js

Find geolocation data from IP addresses (e.g. city, country, timezone) using the IPLocate.io API.

IPLocate.io provides 1,000 free requests per day. For higher plans, check out the website

NPM Package Version NPM Package License NPM Package Downloads devDependencies Status

Node Version Travis CI Build Status Code Climate Status Coverage Status

NPM Package Statistics

Installation

npm install node-iplocate

Usage Example

const iplocate = require("node-iplocate");

iplocate("8.8.8.8").then(function(results) {
  console.log("IP Address: " + results.ip);
  console.log("Country: " + results.country + " (" + results.country_code + ")");
  console.log("Continent: " + results.continent);
  console.log("Organisation: " + results.org + " (" + results.asn + ")");

  console.log(JSON.stringify(results, null, 2));
});

// Or with callbacks
iplocate("8.8.8.8", null, function(err, results) {
  // ...
  console.log(JSON.stringify(results, null, 2));
});

// Provide an API key from IPLocate.io
iplocate("8.8.8.8", { api_key: "abcdef" }).then(function(results) {
  // ...
});

IP Address: 8.8.8.8
Country: United States (US)
Continent: North America
Organisation: Google LLC (AS15169)

{
  "ip": "8.8.8.8",
  "country": "United States",
  "country_code": "US",
  "city": null,
  "continent": "North America",
  "latitude": 37.751,
  "longitude": -97.822,
  "time_zone": null,
  "postal_code": null,
  "org": "Google LLC",
  "asn": "AS15169"
}

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

License

Distributed under the MIT License.

Keywords

FAQs

Package last updated on 20 Mar 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc