IP Geolocation with Node.js from IP2Location.com

IP2Location released geolocation with Node.js with memory utilization
By: IP2Location.com
 
SARASOTA, Fla. - Aug. 16, 2013 - PRLog -- Node.js, or commonly known as Node, is not a very new solution but it helps to solve some important issues sometimes.

According to nodejs.org, Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. It does not create multiple process threads for each invocation incurring a lot less O/S overhead under load. If you are familiar with JavaScript, then you will be able to speed out the development effort when using Node.js which works on both client and server side code basis.

On the other hand, geolocation technologies are transforming how we experience, navigate and ultimately better our world. It helps merchants to target the right audience easily, to become more competitive, maximize revenue or reduce any business risks as well as improving your analytical capabilities. It is common practice in several cases like geolocation marketing, advertisement targeting, and content filtering and so on.

IP2Location has developed a Node.js module to support all of the geolocation database products. It has been optimized for speed and memory utilization. Developers can use the module to query all IP2Location binary databases in applications written for the Node.js platform. See the sample code below.


var ip2loc = require("ip2location-nodejs");

// for both IPv4 and IPv6
ip2loc.IP2Location_init("/path_to_your_database_file/your_IPv4_BIN_file.BIN", "/path_to_your_database_file/your_IPv6_BIN_file.BIN");

// for IPv4 only
// ip2loc.IP2Location_init("/path_to_your_database_file/your_IPv4_BIN_file.BIN");

// for Ipv6 only
// ip2loc.IP2Location_init("", "/path_to_your_database_file/your_IPv6_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]);
   }
}

For more information about the Node.js geolocation, please visit http://www.ip2location.com or email sales@ip2location.com.
End
Source:IP2Location.com
Email:***@gmail.com
Tags:Geolocation, Node.js, Javascript, Trace Ip
Industry:Technology, Software
Location:Sarasota - Florida - United States
Subject:Features
Account Email Address Verified     Account Phone Number Verified     Disclaimer     Report Abuse
Hexasoft Development Sdn. Bhd. PRs
Trending News
Most Viewed
Top Daily News



Like PRLog?
9K2K1K
Click to Share