C Library
PHP Module
Perl Module
Ruby Library
Python Library
Apache Module
Nginx Module
Node.js Module
Cocoa / Objective C Library
Pascal Library
D Library
Go Package
Erlang Module
Haskell Package
Debian Package
Lua Package
Kotlin Module
Scala Library
OpenResty Package
Splunk Add-on
Apache Kafka Transform
OCaml Module
Deno Module
R Package
.NET Component
Java Component
HTTP Module
ActiveX / COM DLL
IP2Location IP Geolocation Node.js Module
This IP Geolocation module is a Node.js module to support all IP2Location™ database products. It has been optimized for speed and memory utilization. Developers can use the module to query all IP2Location™ binary databases for applications written for the Node.js platform.
- Run npm install ip2location-nodejs in your command prompt.
var ip2loc = require("ip2location-nodejs");
ip2loc.IP2Location_init("/path_to_your_database_file/your_BIN_file.BIN");
testip = ['8.8.8.8', '2404:6800:4001:c01::67', '2001:0200:0102:0000:0000:0000:0000:0000', '2001:0200:0135:0000:0000:0000:0000:0000', '2001:0200:017A:0000:0000:0000:0000:0000'];
for (var x = 0; x < testip.length; x++) {
result = ip2loc.IP2Location_get_all(testip[x]);
for (var key in result) {
console.log(key + ": " + result[key]);
}
}
ip2loc.IP2Location_close();
Discover Your User Locations
Retrieve geolocation data for FREE now!