{"analyzedAt":"2022-06-30T13:04:37.679Z","collected":{"metadata":{"name":"mmdb-lib","scope":"unscoped","version":"2.0.2","description":"Maxmind DB (MMDB) Library","keywords":["maxmind","mmdb","geo","geoip","geoip2"],"date":"2022-02-03T04:02:50.270Z","author":{"name":"Dmitry Shirokov","email":"deadrunk@gmail.com","username":"runk"},"publisher":{"username":"runk","email":"deadrunk@gmail.com"},"maintainers":[{"username":"runk","email":"deadrunk@gmail.com"}],"contributors":[{"name":"William Storey @horgh"},{"name":"Uman Shahzad @UmanShahzad"}],"repository":{"type":"git","url":"git+https://github.com/runk/mmdb-lib.git"},"links":{"npm":"https://www.npmjs.com/package/mmdb-lib","homepage":"https://github.com/runk/mmdb-lib","repository":"https://github.com/runk/mmdb-lib","bugs":"http://github.com/runk/mmdb-lib/issues"},"license":"MIT","devDependencies":{"@types/ip-address":"5.8.2","@types/jest":"27.0.0","@types/node":"16.0.0","@types/sinon":"7.5.2","@typescript-eslint/eslint-plugin":"^4.4.0","@typescript-eslint/parser":"^4.4.0","eslint":"^7.10.0","ip-address":"6.2.0","jest":"^27.4.7","prettier":"^2.1.2","semantic-release":"^18.0.1","sinon":"9.0.1","ts-jest":"^27.1.2","ts-node":"^10.4.0","typescript":"4.5.4"},"releases":[{"from":"2022-05-31T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":0},{"from":"2022-04-01T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":1},{"from":"2022-01-01T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":5},{"from":"2021-06-30T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":6},{"from":"2020-06-30T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":11}],"hasTestScript":true,"hasSelectiveFiles":true,"readme":"# mmdb-lib\n\nJavascript library for working with Maxmind binary databases (aka mmdb or geoip2).\n\nLibrary is designed to be agnostic to environment and works equally well in node.js and browser. Module is fully compatible with IPv6. There are no differences in API between IPv4 and IPv6.\n\n## Installation\n\n```shell\nnpm i mmdb-lib\n```\n\n## Usage\n\n```typescript\nimport fs from 'fs';\nimport * as mmdb from 'mmdb-lib';\n\n// Get a buffer with mmdb database, from file system or whereever.\nconst db = fs.readFileSync('/path/to/GeoLite2-City.mmdb');\n\nconst reader = new mmdb.Reader<CityResponse>(db);\nconsole.log(reader.get('66.6.44.4')); // inferred type `CityResponse`\nconsole.log(reader.getWithPrefixLength('66.6.44.4')); // tuple with inferred type `[CityResponse|null, number]`\n```\n\nSupported response types:\n\n```\n- CountryResponse\n- CityResponse\n- AnonymousIPResponse\n- AsnResponse\n- ConnectionTypeResponse\n- DomainResponse\n- IspResponse\n```\n\n## Usage in browser-like environments\n\nLibrary expects to receive an instance of `Buffer` during instantiation of `Reader`. Since there is no direct alternative of node's `Buffer` in browser, you can use https://github.com/feross/buffer that mimics native `Buffer` interface. Neither `ArrayBuffer` nor `Uint8Array` is supported right now. Another requirement is [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) object available.\n\n## Options\n\n_Reader(db:Buffer, [options])_\n\n- `options`: `<Object>`\n  - `cache`: `<Object>` Cache helper. [tiny-lru](https://github.com/avoidwork/tiny-lru) is great basic option. Only two methods expected: `get(key: string | number): any` and `set(key: string | number, val: any): void`.\n\n## References\n\n- Loosely based on https://github.com/PaddeK/node-maxmind-db\n- MaxMind DB file format specification http://maxmind.github.io/MaxMind-DB/\n- MaxMind test/sample DB files https://github.com/maxmind/MaxMind-DB\n- GeoLite2 Free Downloadable Databases http://dev.maxmind.com/geoip/geoip2/geolite2/\n- Great talk about V8 performance https://www.youtube.com/watch?v=UJPdhx5zTaw\n- V8 Optimization killers https://github.com/petkaantonov/bluebird/wiki/Optimization-killers\n- More V8 performance tips http://www.html5rocks.com/en/tutorials/speed/v8/\n\n## License\n\nMIT\n\n## Contributing\n\nadd a link"},"npm":{"downloads":[{"from":"2022-06-29T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":22808},{"from":"2022-06-23T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":116365},{"from":"2022-05-31T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":501952},{"from":"2022-04-01T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":1357822},{"from":"2022-01-01T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":2480653},{"from":"2021-06-30T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":4097579}],"starsCount":0},"github":{"starsCount":10,"forksCount":3,"subscribersCount":3,"issues":{"count":13,"openCount":1,"distribution":{"3600":8,"10800":0,"32400":0,"97200":0,"291600":1,"874800":1,"2624400":1,"7873200":1,"23619600":0,"70858800":1,"212576400":0},"isDisabled":false},"contributors":[{"username":"UmanShahzad","commitsCount":1},{"username":"horgh","commitsCount":1},{"username":"runk","commitsCount":28}],"commits":[{"from":"2022-06-23T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":0},{"from":"2022-05-31T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":0},{"from":"2022-04-01T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":0},{"from":"2022-01-01T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":12},{"from":"2021-06-30T00:00:00.000Z","to":"2022-06-30T00:00:00.000Z","count":14}]},"source":{"files":{"readmeSize":2305,"testsSize":36910,"hasNpmIgnore":true},"linters":["eslint","prettier"]}},"evaluation":{"quality":{"carefulness":0.9199999999999999,"tests":0.6,"health":1,"branding":0},"popularity":{"communityInterest":19,"downloadsCount":452607.3333333333,"downloadsAcceleration":2015.162804414003,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":1,"issuesDistribution":0.9}},"score":{"final":0.6706325142767984,"detail":{"quality":0.8364556389013833,"popularity":0.1991809931623023,"maintenance":0.9999499285702218}}}