Comparing version 3.0.5 to 3.1.0
{ | ||
"name": "maxmind", | ||
"version": "3.0.5", | ||
"version": "3.1.0", | ||
"homepage": "https://github.com/runk/node-maxmind", | ||
@@ -29,13 +29,13 @@ "description": "IP lookup using Maxmind databases", | ||
"devDependencies": { | ||
"@types/sinon": "7.0.11", | ||
"@types/ip-address": "5.8.2", | ||
"@types/jest": "24.0.13", | ||
"@types/node": "10.14.6", | ||
"github-publish-release": "5.0.1", | ||
"ip-address": "5.8.9", | ||
"@types/jest": "24.0.15", | ||
"@types/node": "10.14.12", | ||
"@types/sinon": "7.0.13", | ||
"ip-address": "5.9.2", | ||
"jest": "24.8.0", | ||
"sinon": "7.3.2", | ||
"ts-jest": "24.0.2", | ||
"tslint": "5.16.0", | ||
"typescript": "3.4.5" | ||
"tslint": "5.18.0", | ||
"typescript": "3.4.5", | ||
"semantic-release": "^15.13.18" | ||
}, | ||
@@ -64,5 +64,5 @@ "repository": { | ||
"lint:types": "tsc --noEmit", | ||
"release": "scripts/release", | ||
"test": "jest" | ||
"test": "jest", | ||
"semantic-release": "semantic-release" | ||
} | ||
} |
@@ -39,8 +39,13 @@ # node-maxmind [![Build Status](https://api.travis-ci.org/runk/node-maxmind.svg?branch=master)](https://travis-ci.org/runk/node-maxmind) | ||
console.log(lookup.get('66.6.44.4')); // inferred type maxmind.CityResponse | ||
``` | ||
// Use Reader class directly | ||
### Sync API | ||
You can use `Reader` class directly, if you would want to instantiate it in non-async fashion. Use cases would include receiving a buffer database over network, or just reading it synchronously from disk. | ||
```typescript | ||
import { Reader } from 'maxmind'; | ||
const buffer = await downloadFromCloudToStream(); | ||
const buffer = fs.readFileSync('./db.mmdb'); | ||
const lookup = new Reader<CityResponse>(buffer); | ||
let city = lookup.get('8.8.8.8'); // inferred type maxmind.CityResponse | ||
const city = lookup.get('8.8.8.8'); | ||
``` | ||
@@ -47,0 +52,0 @@ |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
114
0
6908
3
0
2