
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
geoip2-api
Advanced tools
This module allows obtaining the client's geolocation using their IP address, leveraging data retrieved from a fast API.
This documentation covers a lightweight Node.js module designed for interacting with a geolocation data API. The module enables efficient retrieval of location details for specific IP addresses, utilizing native modules for optimal performance.
We utilize the MaxMind database via the geoip-lite2 module for our API.
There is an alternative to this module that allows for local geolocation retrieval based on a specific IP address. However, this will increase the memory usage because the alternative module stores the MaxMind database in RAM.
npm install geoip2-api
const geoIp = require('geoip2-api');
(async () => {
const data = await geoIp.get('185.21.84.216');
console.log(data);
});
{
"success": true,
"status": 200,
"ip": "185.21.84.216",
"data": {
"range": [3105182720, 3105183743],
"country": "PL",
"region": "30",
"eu": "1",
"timezone": "Europe/Warsaw",
"city": "Piła",
"ll": [53.1492, 16.7461],
"metro": 0,
"area": 20
},
"type": "unicast"
}
If you want to get the client's geolocation, instead of providing an IP, use /api/v2/geoip/myip
.
For any questions or issues related to the script, please visit the GitHub repository for the latest updates and support.
If you like this module, please star ⭐ the repository.
This GeoIP API client script is provided under the MIT License. See the LICENSE file for more details.
Copyright 2023-2024 © by Sefinek. All Rights Reserved.
FAQs
This module allows obtaining the client's geolocation using their IP address, leveraging data retrieved from a fast API.
The npm package geoip2-api receives a total of 118 weekly downloads. As such, geoip2-api popularity was classified as not popular.
We found that geoip2-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.