Gathering detailed insights and metrics for ip3country
Gathering detailed insights and metrics for ip3country
Gathering detailed insights and metrics for ip3country
Gathering detailed insights and metrics for ip3country
A JavaScript, zero-dependency, super small version of IP2Location LITE country lookups.
npm install ip3country
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
ISC License
40 Stars
46 Commits
4 Watchers
15 Branches
6 Contributors
Updated on Oct 05, 2024
Latest Version
5.0.0
Package Id
ip3country@5.0.0
Unpacked Size
464.92 kB
Size
241.63 kB
File Count
6
NPM Version
7.5.3
Node Version
15.9.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
This is a zero-dependency, super small, IP address to 2-letter country code lookup library. There are already several libraries available, but none met our requirements for binary size and speed.
This project in its entirety is <300KB, compared to most alternatives out there that are north of 40MB (but might provide more than just countries).
(Other languages: Python: https://github.com/statsig-io/ip3country-py, Go: https://github.com/statsig-io/ip3country-go, Ruby: https://github.com/statsig-io/ip3country-ruby, Kotlin: https://github.com/statsig-io/ip3country-kotlin, C#/.Net: https://github.com/statsig-io/ip3country-dotnet)
The database used in this project is compacted from IP2Location. Their DB1.LITE edition is provided under CCA, with the attribution below:
NOTE
This site or product includes IP2Location LITE data available from https://lite.ip2location.com.
1$ npm install ip3country
1// Setup 2const ip3country = require("ip3country"); 3 4ip3country.init(); 5 6// Lookup using ip4 str 7ip3country.lookupStr("123.45.67.8"); // 'KR'. 8 9// Lookup using numeric ip 10console.log(ip3country.lookupNumeric(2066563848));
ip3country
's accuracy is dependent on IP2Location LITE's accuracy. In our experience, for country lookups, it is accurate enough for most applications.
IP2Location publishes accuracy reports here: https://www.ip2location.com/data-accuracy
There's also this third party report available: https://www.cl.cam.ac.uk/~nz247/publications/JSAC2011-Geolocation.pdf
To make this library easy to consume, we're using btoj to transform the necessary binary data into a js module that can be imported like any other module. You won't need to list ip3country
as an external in your build process.
We're currently using brotli compression via NodeJS's zlib
library, which won't work in Browser environments. If you want ip3country
on a browser, check version 3.0.0
(and feel free to publish ip3country-browser
).
All variants of "ip2country" were already taken in npm, so we decided to step it up.
At Statsig, we needed a library to evaluate location-based conditions on Feature Gates (Feature Flags). We use ip3country to power country-level rollouts or A/B tests for new features.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 22/29 approved changesets -- score normalized to 7
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More