ip2location-nodejs
Advanced tools
Comparing version 9.4.0 to 9.4.1
{ | ||
"name": "ip2location-nodejs", | ||
"version": "9.4.0", | ||
"version": "9.4.1", | ||
"description": "IP2Location geolocation component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -201,1 +201,47 @@ [![npm](https://img.shields.io/npm/v/ip2location-nodejs.svg)](http://npm.im/ip2location-nodejs) | ||
``` | ||
## COUNTRY CLASS | ||
## Methods | ||
Below are the methods supported in this module. | ||
|Method Name|Description| | ||
|---|---| | ||
|getCountryInfo(countryCode)|Returns the country information.| | ||
## Usage | ||
```javascript | ||
const {Country} = require("ip2location-nodejs"); | ||
let country = new Country("./IP2LOCATION-COUNTRY-INFORMATION-BASIC.CSV"); | ||
country.getCountryInfo("US").then(country_info => { | ||
console.log(country_info); | ||
}); | ||
country.getCountryInfo("").then(country_info => { | ||
console.log(country_info); | ||
}); | ||
``` | ||
## REGION CLASS | ||
## Methods | ||
Below are the methods supported in this module. | ||
|Method Name|Description| | ||
|---|---| | ||
|getRegionCode(countryCode, regionName)|Returns the region code for the supplied country code and region name.| | ||
## Usage | ||
```javascript | ||
const {Region} = require("ip2location-nodejs"); | ||
let region = new Region("./IP2LOCATION-ISO3166-2.CSV"); | ||
region.getRegionCode("US", "California").then(region_code => { | ||
console.log(region_code); | ||
}); | ||
``` |
@@ -8,3 +8,3 @@ var net = require("net"); | ||
// For BIN queries | ||
const VERSION = "9.4.0"; | ||
const VERSION = "9.4.1"; | ||
const MAX_INDEX = 65536; | ||
@@ -11,0 +11,0 @@ const COUNTRY_POSITION = [ |
77542
247