{"id":15451797,"url":"https://github.com/willscott/ip2country","last_synced_at":"2025-11-17T03:44:02.551Z","repository":{"id":23900960,"uuid":"27280796","full_name":"willscott/ip2country","owner":"willscott","description":"A standalone ip -\u003e country lookup table. Prebuilt \u0026 Redistributable.","archived":false,"fork":false,"pushed_at":"2025-04-29T00:42:16.000Z","size":176,"stargazers_count":28,"open_issues_count":3,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-23T08:48:11.269Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willscott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-11-28T20:13:46.000Z","updated_at":"2025-04-29T00:42:19.000Z","dependencies_parsed_at":"2025-07-23T08:33:32.913Z","dependency_job_id":null,"html_url":"https://github.com/willscott/ip2country","commit_stats":null,"previous_names":[],"tags_count":62,"template":false,"template_full_name":null,"purl":"pkg:github/willscott/ip2country","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fip2country","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fip2country/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fip2country/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fip2country/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willscott","download_url":"https://codeload.github.com/willscott/ip2country/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fip2country/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284818572,"owners_count":27068110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-17T02:00:06.431Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T21:39:32.288Z","updated_at":"2025-11-17T03:44:02.536Z","avatar_url":"https://github.com/willscott.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"IP 2 Country\n============\n\nIP 2 Country provides a current lookup table to geolocate IP address to\nthe countries in which they are most probably located. Distributed as a\nstand-alone NPM module with no dependencies, the list is created at publication\ntime. This mapping is generated through the use of two databases:\n\n * [autnums](http://www.cidr-report.org/as2.0/autnums.html) Provides a\n    textual descriptiosn of each registered ASN, including the country to which\n    that ASN is registered.\n * [routeviews.org orginas](http://www.routeviews.org/) Provides a\n    current list of BGP announcements, allowing us to understand which ASNs\n    are announcing ownership of which IP prefixes.\n\nSize\n-----\n\n```\n4.3M ip2country.js\n1.1M ip2country.js.gz\n```\n\nInstallation\n-----\n\n```\n  npm install ip2country\n```\n\nUsage\n-----\n\n```javascript\nimport ip2country from 'ip2country';\nlet country = ip2country(ip);\n```\n\nAdvanced Usage\n--------------\n\nThere are several related lookup tables for IP addresses that may be of use.\nWhile not published for direct consumption, this library contains the tools\nto generate those tables for your process. This functionality is accessed\nthrough the ```getGenericMap()``` function in build.js. In particular, the\nfollowing knobs are exposed when generating the lookup table:\n\n  * compress - Should the table be de-duplicated? When false the table will be\n    faster to generate but slower to look up.\n  * toCountry - Should the ip-ASN table be joined with an ASN-country table?\n    When false an IP-ASN lookup table will be generated.\n  * when - At what point should the table be generated? If set, the full RIB -\n    routing information base - from the given time will be loaded and an\n    originas extracted from that file (see historicBGPData.js).\n  * nocache - Should a new originas be downloaded even if one already exists\n    on disk? (defaults to false).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillscott%2Fip2country","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillscott%2Fip2country","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillscott%2Fip2country/lists"}