Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@e9x/ipi
Advanced tools
Readme
A free library/cli tool to get IP information.
Due to the nature of libraries used (SQLite3, IP2Location), this project is seemingly littered with synchronous operations.
Despite this, this project still delivers reasonable runtime performance that beats using an API.
Benchmarks: (not quite accurate, tested on my development machine)
test | duration |
---|---|
require() | 44.36 ms |
ipi() | 0.066 ms |
An extreme solution to the blocking API is wrapping the API with piscina.
You might want to update the databases library from time to time. Databases will be updated usually every month (No guarantees 😅️)
npm i @e9x/ipi-databases@latest
Example:
import ipi from "@e9x/ipi";
const ipInfo = ipi("69.42.0.123");
console.log(ipInfo);
{
success: true,
asn: 11404,
asd: 'AS-WAVE-1',
city: 'San Francisco',
region: 'California',
zipCode: '94102',
timezone: '-08:00',
latitude: 37.774929,
longitude: -122.419418,
countryLong: 'United States of America',
countryShort: 'US'
}
If you need to access the IPInfo type (TypeScript):
import ipi, { IPInfo } from "@e9x/ipi";
const whatever: IPInfo = ipi("69.42.0.123");
console.log(whatever);
Install the CLI tool globally:
$ npm install --location=global @e9x/ipi
If you encounter a read/write error when running the tool after installing globally on Linux, refer to https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md
The CLI syntax is as follows:
Usage: ipi <IP>
IP-Info cli
Arguments:
IP IP address. Can be IPv4 or IPv6.
Example:
$ ipi 2607:f188::dead:beef:cafe:fed1
{
success: true,
asn: 21769,
asd: 'AS-COLOAM',
city: 'Las Vegas',
region: 'Nevada',
zipCode: '89136',
timezone: '-07:00',
latitude: 36.174969,
longitude: -115.137222,
countryLong: 'United States of America',
countryShort: 'US'
}
Install the dependency:
$ npm i @e9x/ipi
See examples/ for examples of the API.
As of v2.0.0-beta, this package is safe to use in libraries! Data fetching is done when publishing the package.
FAQs
A free library/cli tool to get IP information.
The npm package @e9x/ipi receives a total of 3 weekly downloads. As such, @e9x/ipi popularity was classified as not popular.
We found that @e9x/ipi 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.