Releases: Richienb/iplocation
Releases · Richienb/iplocation
v7.2.0
v7.1.0
v7.0.0
Breaking
- Callback support has been removed in favour of promises.
Replacement:
- ipLocation("172.217.167.78", [], (error, result) => {...})
+ ipLocation("172.217.167.78").then((result) => {...}).catch((error) => {...})
- Support for the provider array was removed.
Replacement: See the previous diff.
- The resolved object is now differently constructed.
Difference:
{
- city: "Mountain View",
- country: "US",
- countryCode: "US",
- ip: "172.217.167.78",
latitude: 37.4056,
longitude: -122.0775,
- postal: "94043",
- region: "California",
- regionCode: "",
- timezone: "America/Los_Angeles"
+ region: {
+ name: "New South Wales",
+ code: "NSW"
+ },
+ country: {
+ name: "Australia",
+ code: "AU",
+ iso3: "AUS",
+ capital: "Canberra",
+ tld: ".au",
+ population: 21515754,
+ area: 7686850,
+ callingCode: "+61",
+ postalCode: "2000",
+ timezone: {
+ code: "Australia/Sydney",
+ offset: "+1100"
+ },
+ currency: {
+ name: "Dollar",
+ code: "AUD"
+ },
+ languages: ["en-AU"]
+ },
+ continent: {
+ code: "OC",
+ inEu: false
+ }
}
TypeError
is now thrown instead ofInvalidIPError
.ky.HTTPError
andky.TimeoutError
is now thrown instead ofProviderError
.- Support for
debug
has been removed. - Node.js 10 or later is now required.
Enhancements
- Allow importing normally in CommonJS.
- Modern browsers are now supported. You can optionally use a bundler to support older ones.
Fixes
- Stopped trying to contact an API that started requiring API keys. This leaves only one API, allowing the results to stay consistent between runs.
- The
request
package was removed, stopping the deprecation message.