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

maxmind

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maxmind

IP lookup using Maxmind databases

4.3.24
latest
Version published
Weekly downloads
220K
-0.53%
Maintainers
1
Weekly downloads
 
Created

What is maxmind?

The maxmind npm package provides tools for IP geolocation and other related functionalities using MaxMind's GeoIP2 and GeoLite2 databases. It allows developers to determine the geographical location, ISP, and other details of an IP address.

What are maxmind's main functionalities?

IP Geolocation

This feature allows you to determine the geographical location of an IP address. The code sample demonstrates how to use the GeoLite2-City database to get the city information for the IP address '8.8.8.8'.

const maxmind = require('maxmind');
const lookup = async (ip) => {
  const cityLookup = await maxmind.open('GeoLite2-City.mmdb');
  const city = cityLookup.get(ip);
  console.log(city);
};
lookup('8.8.8.8');

ISP Information

This feature allows you to get the ISP information of an IP address. The code sample demonstrates how to use the GeoIP2-ISP database to get the ISP details for the IP address '8.8.8.8'.

const maxmind = require('maxmind');
const lookup = async (ip) => {
  const ispLookup = await maxmind.open('GeoIP2-ISP.mmdb');
  const isp = ispLookup.get(ip);
  console.log(isp);
};
lookup('8.8.8.8');

Anonymous IP Detection

This feature allows you to detect if an IP address is associated with anonymous networks such as VPNs, proxies, or Tor. The code sample demonstrates how to use the GeoIP2-Anonymous-IP database to get anonymous IP details for the IP address '8.8.8.8'.

const maxmind = require('maxmind');
const lookup = async (ip) => {
  const anonLookup = await maxmind.open('GeoIP2-Anonymous-IP.mmdb');
  const anon = anonLookup.get(ip);
  console.log(anon);
};
lookup('8.8.8.8');

Other packages similar to maxmind

FAQs

Package last updated on 22 Jan 2025

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