Skip to content

Commit

Permalink
Use ip_supalite from latest btoj (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
roim authored Jul 20, 2021
1 parent 248f153 commit 648d6aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This is a zero-dependency, super small, IP address to 2-letter [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) lookup library. There are already several libraries available, but none met our requirements for binary size and speed.

This project in its entirety is <500KB, compared to most alternatives out there that are north of 40MB (but might provide more than just countries).
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).

The database used in this project is compacted from [IP2Location](https://lite.ip2location.com/database/ip-country). Their DB1.LITE edition is provided under CCA, with the attribution below:

Expand Down Expand Up @@ -43,6 +43,12 @@ IP2Location publishes accuracy reports here: https://www.ip2location.com/data-ac

There's also this third party report available: https://www.cl.cam.ac.uk/~nz247/publications/JSAC2011-Geolocation.pdf

## Binary data

To make this library easy to consume, we're using [btoj](https://github.com/statsig-io/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](https://nodejs.org/api/zlib.html#zlib_zlib_brotlicompresssync_buffer_options), 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`).

## Name

All variants of "ip2country" were already taken in npm, so we decided to step it up.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ip3country",
"version": "3.0.0",
"version": "4.0.0",
"description": "This is a no-dependency, super lite version of IP2Location LITE lookup.",
"main": "src/ip3country.js",
"files": [
Expand Down
Binary file modified src/ip_supalite.js
Binary file not shown.

0 comments on commit 648d6aa

Please sign in to comment.