{"analyzedAt":"2023-01-11T19:11:20.418Z","collected":{"metadata":{"name":"geoip-country","scope":"unscoped","version":"4.1.39","description":"Less memory usage version of geoip-lite, by supporting only country lookup.","keywords":["geo","geoip","ip","ipv4","ipv6","geolookup","maxmind","geolite"],"date":"2023-01-11T02:57:01.264Z","author":{"name":"sapics","url":"https://github.com/sapics"},"publisher":{"username":"sapics","email":"sapics77@gmail.com"},"maintainers":[{"username":"sapics","email":"sapics77@gmail.com"}],"contributors":[{"name":"Philip Tellis","email":"philip@bluesmoon.info","url":"http://bluesmoon.info/"}],"repository":{"type":"git","url":"git://github.com/sapics/geoip-country.git"},"links":{"npm":"https://www.npmjs.com/package/geoip-country","homepage":"https://github.com/sapics/geoip-country","repository":"https://github.com/sapics/geoip-country","bugs":"https://github.com/sapics/geoip-country/issues"},"dependencies":{"async":"^2.6.4","colors":"^1.4.0","iconv-lite":"^0.5.2","ip-address":"^6.3.0","lazy":"^1.0.11","rimraf":"^2.7.1","yauzl":"^2.10.0"},"devDependencies":{"nodeunit-x":"^0.15.0"},"releases":[{"from":"2022-12-12T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":4},{"from":"2022-10-13T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":12},{"from":"2022-07-15T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":25},{"from":"2022-01-11T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":55},{"from":"2021-01-11T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":107}],"hasTestScript":true,"hasSelectiveFiles":true,"readme":"# geoip-country [![NPM version](https://badge.fury.io/js/geoip-country.svg)](https://badge.fury.io/js/geoip-country)\n\nLess memory usage version of [geoip-lite](https://github.com/bluesmoon/node-geoip) by limiting to country information.\nThis product includes GeoLite2 ipv4 and ipv6 country data which created by MaxMind, available from https://www.maxmind.com.\nThe database of this product **updates weekly**.\n\n**You should read this README and the LICENSE and EULA files carefully before deciding to use this product.**<br>\n**After v4, LICENSE for the database was changed. If you need to use this product with previous LICENSE, please use v3.**\n\n\n## Synopsis\n\n```javascript\nvar geoip = require('geoip-country');\n\nvar ip = \"207.97.227.239\";\nvar geo = geoip.lookup(ip);\n\nconsole.log(geo);\n{ range: [ 3479299040, 3479299071 ],\n  country: 'US'}\n```\n\n\n## Installation\n\n### 1. Install the library\n\n    $ npm install geoip-country\n\n### 2. Update MaxMind's geoip data\n\n    $ npm run-script updatedb --license_key=YOUR_GEOLITE2_LICENSE_KEY\n\t\tor\n    $ GEOLITE2_LICENSE_KEY=YOUR_GEOLITE2_LICENSE_KEY node scripts/updatedb.js\n\n_YOUR_GEOLITE2_LICENSE_KEY should be replaced by a valid GeoLite2 license key. Please [follow instructions](https://dev.maxmind.com/geoip/geoip2/geolite2/) provided by MaxMind to obtain a license key._\n\n\n## API\n\ngeoip-country is completely synchronous.  There are no callbacks involved.  All blocking file IO is done at startup time, so all runtime\ncalls are executed in-memory and are fast.  Startup may take up to 20ms while it reads into memory and indexes data files.\n\n### Looking up an IP address ###\n\nIf you have an IP address in dotted quad notation, IPv6 colon notation, or a 32 bit unsigned integer (treated\nas an IPv4 address), pass it to the `lookup` method.  Note that you should remove any `[` and `]` around an\nIPv6 address before passing it to this method.\n\n```javascript\nvar geo = geoip.lookup(ip);\n```\n\nIf the IP address was found, the `lookup` method returns an object with the following structure:\n\n```javascript\n{\n   range: [ <low bound of IP block>, <high bound of IP block> ],\n   country: 'XX' // 2 letter ISO-3166-1 country code\n}\n```\n\nThe actual values for the `range` array depend on whether the IP is IPv4 or IPv6 and should be\nconsidered internal to `geoip-country`.  To get a human readable format, pass them to `geoip.pretty()`\n\nIf the IP address was not found, the `lookup` returns `null`\n\n### Update database API [Added at v4.1.0]\n\nYou can update country database with `updateDatabase` method.\n\n```javascript\n    geoip.updateDatabase(license_key, callback);\n```\n\n`license_key` is a license key which provided by MaxMind. You can get GeoLite2 license key as [instructions](https://dev.maxmind.com/geoip/geoip2/geolite2/).\n\n### Pretty printing an IP address ###\n\nIf you have a 32 bit unsigned integer, or a number returned as part of the `range` array from the `lookup` method,\nthe `pretty` method can be used to turn it into a human readable string.\n\n```javascript\n    console.log(\"The IP is %s\", geoip.pretty(ip));\n```\n\nThis method returns a string if the input was in a format that `geoip-country` can recognize, else it returns the\ninput itself.\n\n\n## Built-in Updater\n\nThis package contains an update script that can pull the files from MaxMind and handle the conversion from CSV.\nA npm script alias has been setup to make this process easy. Please keep in mind this requires internet and MaxMind\nrate limits that amount of downloads on their servers.\n\n```shell\nnpm run-script updatedb --license_key=YOUR_GEOLITE2_LICENSE_KEY\n\tor\nGEOLITE2_LICENSE_KEY=YOUR_GEOLITE2_LICENSE_KEY node scripts/updatedb.js\n```\n\n_YOUR_GEOLITE2_LICENSE_KEY should be replaced by a valid GeoLite2 license key. Please [follow instructions](https://dev.maxmind.com/geoip/geoip2/geolite2/) provided by MaxMind to obtain a license key._\n\n\n## License and EULA\n\nPlease carefully read the LICENSE and EULA files. This package comes with certain restrictions and obligations, most notably:\n - You cannot prevent the library from updating the databases.\n - You cannot use the GeoLite2 data:\n   - for FCRA purposes,\n   - to identify specific households or individuals.\n\nYou can read [the latest version of GeoLite2 EULA](https://www.maxmind.com/en/geolite2/eula).\n\n\n## References\n  - <a href=\"https://www.maxmind.com/en/geolite2/eula\">GeoLite2 EULA</a>\n  - <a href=\"https://www.maxmind.com/app/iso3166\">Documentation from MaxMind</a>\n  - <a href=\"https://en.wikipedia.org/wiki/ISO_3166\">ISO 3166 (1 & 2) codes</a>\n  - <a href=\"https://en.wikipedia.org/wiki/List_of_FIPS_region_codes\">FIPS region codes</a>"},"npm":{"downloads":[{"from":"2023-01-10T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":14052},{"from":"2023-01-04T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":56643},{"from":"2022-12-12T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":175231},{"from":"2022-10-13T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":507172},{"from":"2022-07-15T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":824256},{"from":"2022-01-11T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":1339644}],"starsCount":1},"github":{"forkOf":"geoip-lite/node-geoip","starsCount":63,"forksCount":8,"subscribersCount":4,"issues":{"count":13,"openCount":0,"distribution":{"3600":6,"10800":1,"32400":0,"97200":2,"291600":1,"874800":1,"2624400":0,"7873200":1,"23619600":0,"70858800":1,"212576400":0},"isDisabled":false},"contributors":[{"username":"actions-user","commitsCount":129},{"username":"bluesmoon","commitsCount":65},{"username":"sapics","commitsCount":63},{"username":"parisholley","commitsCount":5},{"username":"chill117","commitsCount":4},{"username":"Jimflip","commitsCount":3},{"username":"jonathanong","commitsCount":3},{"username":"GUI","commitsCount":2},{"username":"tshemsedinov","commitsCount":2},{"username":"valeriansaliou","commitsCount":2},{"username":"jordanj77","commitsCount":1},{"username":"orktes","commitsCount":1},{"username":"serby","commitsCount":1},{"username":"ctalkington","commitsCount":1},{"username":"michaelficarra","commitsCount":1},{"username":"elcct","commitsCount":1},{"username":"patelatharva","commitsCount":1},{"username":"estliberitas","commitsCount":1},{"username":"echiu64","commitsCount":1},{"username":"ramonsnir","commitsCount":1},{"username":"ecwyne","commitsCount":1},{"username":"steve-gh","commitsCount":1},{"username":"Strajk","commitsCount":1},{"username":"inversion","commitsCount":1},{"username":"64json","commitsCount":1},{"username":"DylanPiercey","commitsCount":1},{"username":"santiagoecheverri94","commitsCount":1}],"commits":[{"from":"2023-01-04T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":1},{"from":"2022-12-12T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":5},{"from":"2022-10-13T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":14},{"from":"2022-07-15T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":27},{"from":"2022-01-11T00:00:00.000Z","to":"2023-01-11T00:00:00.000Z","count":68}]},"source":{"files":{"readmeSize":4622,"testsSize":2602},"outdatedDependencies":{"rimraf":{"required":"^2.7.1","stable":"3.0.2","latest":"3.0.2"},"ip-address":{"required":"^6.3.0","stable":"8.1.0","latest":"8.1.0"},"iconv-lite":{"required":"^0.5.2","stable":"0.6.3","latest":"0.6.3"},"async":{"required":"^2.6.4","stable":"3.2.4","latest":"3.2.4"}}}},"evaluation":{"quality":{"carefulness":0.46,"tests":0.6,"health":0.5,"branding":0},"popularity":{"communityInterest":103,"downloadsCount":169057.33333333334,"downloadsAcceleration":769.9295662100458,"dependentsCount":0},"maintenance":{"releasesFrequency":1,"commitsFrequency":0.9,"openIssues":1,"issuesDistribution":0.9}},"score":{"final":0.6170510291911357,"detail":{"quality":0.6936826603449002,"popularity":0.1684294991980041,"maintenance":0.9999883039096124}}}