Skip to content

Releases: Richienb/iplocation

v7.2.0

29 Apr 01:44
16d6848
Compare
Choose a tag to compare

Enhancements

v7.1.0...v7.2.0

v7.1.0

24 Apr 13:22
Compare
Choose a tag to compare

Enhancements

v7.0.0

03 Apr 14:25
8dd46b7
Compare
Choose a tag to compare

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 of InvalidIPError.
  • ky.HTTPError and ky.TimeoutError is now thrown instead of ProviderError.
  • 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.