{"analyzedAt":"2022-07-09T21:10:53.177Z","collected":{"metadata":{"name":"geoip2","scope":"unscoped","version":"1.0.5","description":"Maxmind GeoIP2 database reader for geolocating ip addresses.  Fast native implementation by wrapping libmaxminddb.","keywords":["geoip","geoip2","geolocation","maxmind","mmdb","maxminddb","ip"],"date":"2016-10-20T00:46:09.899Z","author":{"name":"David Tsai"},"publisher":{"username":"davidtsai","email":"anatari@gmail.com"},"maintainers":[{"username":"davidtsai","email":"anatari@gmail.com"}],"repository":{"type":"git","url":"git://github.com/davidtsai/node-geoip2.git"},"links":{"npm":"https://www.npmjs.com/package/geoip2","homepage":"https://github.com/davidtsai/node-geoip2#readme","repository":"https://github.com/davidtsai/node-geoip2","bugs":"https://github.com/davidtsai/node-geoip2/issues"},"license":"MIT","dependencies":{"nan":"2.3.5"},"devDependencies":{"mocha":"^2.5.1","chai":"^3.5.0"},"releases":[{"from":"2022-06-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1},{"from":"2022-04-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1},{"from":"2022-01-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1},{"from":"2021-07-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1},{"from":"2020-07-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1}],"hasTestScript":true,"readme":"# geoip2\nMaxmind GeoIP2 database API for geolocating ip addresses.\n\nFast native implementation by wrapping libmaxminddb to read MaxMind's GeoIP2 mmdb databases.\n\nFor ease of use, this module includes the GeoLite2 database created by MaxMind, available from http://www.maxmind.com.  To get more accurate results, this module can also be used with the GeoIP2 database sold by MaxMind.\n\n## Installation\n`npm install --save geoip2`\n\nWill compile libmaxminddb and node bindings on install.  Currently only tested on Linux (x64) and OS X (x64) running Nodejs 0.12.x or Nodejs 4.x.  To add support for more platforms, the config header files need to be generated on the platform from libmaxminddb.\n\n## Usage\nLookup an ip address:\n```\nvar geoip2 = require('geoip2');\ngeoip2.init();\ngeoip2.lookupSimple(\"67.183.57.64\", function(error, result) {\n  if (error) {\n    console.log(\"Error: %s\", error);\n  }\n  else if (result) {\n    console.log(result);\n  }\n});\n```\nProduces:\n```\n{\n  country: 'US',\n  continent: 'NA',\n  postal: '98275',\n  city: 'Mukilteo',\n  location: {\n    latitude: 47.9445,\n    longitude: -122.3046,\n    metro_code: 819,\n    time_zone: 'America/Los_Angeles'\n  },\n  subdivision: 'WA'\n}\n```\n\nYou can also lookup the full data record for the address using the `lookup()` method instead.\n\nTo initialize geoip2 with a different database, pass in the file path to the `init()` method:\n```\ngeoip2.init('/path/to/GeoIp2-City.mmdb');\n```\n\n## API\n**geoip2.init(filePath)**  \nInitializes the default database to the specified file.\n\n**geoip2.cleanup()**  \nCleans up the default database.  Shouldn't be called unless you are done looking up addresses.\n\n**geoip2.lookup(address, callback)**  \nLooks up the full data record for an address *asynchronously*.\nFor documentation on the result object returned see: http://dev.maxmind.com/geoip/geoip2/web-services/.\n\n**geoip2.lookupSync(address)**  \nLooks up the full data record for an address *synchronously*.\n\n**geoip2.lookupSimple(address, callback)**  \nLooks up the simple data record for an address *asynchronously*.\n\n**geoip2.lookupSimpleSync(address)**  \nLooks up the simple data record for an address *synchronously*.\n\n**geoip2.MMDB**  \nUnderlying class to create different instances of the DB.  Only needed for advanced usage.\n\n*libmaxminddb* might be fast enough that the asynchronous API's are unneccessary.  Would be interested to know if anyone has stats for this at very high volume."},"npm":{"downloads":[{"from":"2022-07-08T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1},{"from":"2022-07-02T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":15},{"from":"2022-06-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":186},{"from":"2022-04-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":679},{"from":"2022-01-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":1463},{"from":"2021-07-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":13177}],"starsCount":4},"github":{"starsCount":58,"forksCount":24,"subscribersCount":5,"issues":{"count":35,"openCount":13,"distribution":{"3600":7,"10800":0,"32400":4,"97200":0,"291600":0,"874800":3,"2624400":3,"7873200":1,"23619600":3,"70858800":1,"212576400":13},"isDisabled":false},"contributors":[{"username":"blimmer","commitsCount":1},{"username":"DeadAlready","commitsCount":1},{"username":"pandrese","commitsCount":1},{"username":"davidtsai","commitsCount":36},{"username":"czyzykowski","commitsCount":1}],"commits":[{"from":"2022-07-02T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0},{"from":"2022-06-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0},{"from":"2022-04-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0},{"from":"2022-01-10T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0},{"from":"2021-07-09T00:00:00.000Z","to":"2022-07-09T00:00:00.000Z","count":0}],"statuses":[{"context":"continuous-integration/appveyor/branch","state":"failure"},{"context":"ci/circleci","state":"success"}]},"source":{"files":{"readmeSize":2439,"testsSize":1589},"outdatedDependencies":{"nan":{"required":"2.3.5","stable":"2.16.0","latest":"2.16.0"}}}},"evaluation":{"quality":{"carefulness":0.71,"tests":0.725,"health":0.75,"branding":0},"popularity":{"communityInterest":96,"downloadsCount":226.33333333333334,"downloadsAcceleration":-14.468740487062405,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":0.9,"issuesDistribution":0.9}},"score":{"final":0.6268140016016142,"detail":{"quality":0.8174357747055174,"popularity":0.09035707801364269,"maintenance":0.9998808339576686}}}