![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
ip2location-nodejs
Advanced tools
This Node.js module provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, usage type, address type and IAB category from IP address by using IP2Location database. This module uses a file based database available at IP2Location.com. This database simply contains IP blocks as keys, and other information such as country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, usage type, address type and IAB category as values. It supports both IP address in IPv4 and IPv6.
This module can be used in many types of projects such as:
The database will be updated on a monthly basis for greater accuracy.
The complete database is available at https://www.ip2location.com under Premium subscription package. The free LITE database is available at https://lite.ip2location.com.
As an alternative, this module can also call the IP2Location Web Service. This requires an API key. If you don't have an existing API key, you can subscribe for one at the below:
https://www.ip2location.com/web-service/ip2location
To install this module type the following:
npm install ip2location-nodejs
This library requires IP2Location BIN data file to function. You may download the BIN data file at
Use the IPv4 BIN file if you just need to query IPv4 addresses. If you query an IPv6 address using the IPv4 BIN, you'll see the IPV6_NOT_SUPPORTED error.
Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.
Below are the methods supported in this module.
Method Name | Description |
---|---|
open | Opens the IP2Location BIN data for lookup. |
getAll | Returns the geolocation information in an object. |
getCountryShort | Returns the country code. |
getCountryLong | Returns the country name. |
getRegion | Returns the region name. |
getCity | Returns the city name. |
getISP | Returns the ISP name. |
getLatitude | Returns the latitude. |
getLongitude | Returns the longitude. |
getDomain | Returns the domain name. |
getZIPCode | Returns the ZIP code. |
getTimeZone | Returns the time zone. |
getNetSpeed | Returns the net speed. |
getIDDCode | Returns the IDD code. |
getAreaCode | Returns the area code. |
getWeatherStationCode | Returns the weather station code. |
getWeatherStationName | Returns the weather station name. |
getMCC | Returns the mobile country code. |
getMNC | Returns the mobile network code. |
getMobileBrand | Returns the mobile brand. |
getElevation | Returns the elevation in meters. |
getUsageType | Returns the usage type. |
getAddressType | Returns the address type. |
getCategory | Returns the IAB category. |
close | Closes BIN file and resets metadata. |
const {IP2Location} = require("ip2location-nodejs");
let ip2location = new IP2Location();
ip2location.open("./DB25.BIN");
testip = ['8.8.8.8', '2404:6800:4001:c01::67'];
for (var x = 0; x < testip.length; x++) {
result = ip2location.getAll(testip[x]);
for (var key in result) {
console.log(key + ": " + result[key]);
}
console.log("--------------------------------------------------------------");
}
ip2location.close();
Below are the methods supported in this module.
Method Name | Description |
---|---|
open | 3 input parameters:
|
lookup | Query IP address. This method returns an object containing the geolocation info.
|
getCredit() | This method returns the web service credit balance in an object. |
const {IP2LocationWebService} = require("ip2location-nodejs");
let ws = new IP2LocationWebService();
let ip = "8.8.8.8";
let apiKey = "YOUR_API_KEY";
let apiPackage = "WS25";
let useSSL = true;
// addon and lang to get more data and translation (leave both blank if you don't need them)
let addon = "continent,country,region,city,geotargeting,country_groupings,time_zone_info";
let lang = "fr";
ws.open(apiKey, apiPackage, useSSL);
ws.lookup(ip, addon, lang, (err, data) => {
if (!err) {
console.log(data);
ws.getCredit((err, data) => {
if (!err) {
console.log(data);
}
});
}
});
FAQs
IP2Location geolocation component
The npm package ip2location-nodejs receives a total of 0 weekly downloads. As such, ip2location-nodejs popularity was classified as not popular.
We found that ip2location-nodejs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.