Releases: ipregistry/ipregistry-javascript
Releases · ipregistry/ipregistry-javascript
Release list
v7.0.0
Added
- Options-object API: construct the client with
new IpregistryClient({ apiKey, baseUrl, timeout, maxRetries, cache, ... })and pass per-call options as a plain object, e.g.client.lookupIp(ip, { fields: 'location', hostname: true }). ThebaseUrloption accepts the shorthand'eu'for the European Union endpoint. - Request cancellation: every lookup accepts an
AbortSignalvia{ signal }. Aborting cancels the in-flight request, pending retries and their backoff waits, and pending batch chunks. parseUserAgentsaccepts an array (client.parseUserAgents([ua1, ua2])) in addition to the deprecated variadic form.- Generic cache typing:
IpregistryCache<V>and the newIpregistryCacheValuetype.
Changed
- The library is now compiled with full TypeScript strict mode (
noImplicitAnyenabled).
Deprecated
IpregistryConfigBuilder: pass anIpregistryClientOptionsobject to the constructor instead.IpregistryOption,FilterOption,HostnameOption,IpregistryOptionsand the variadic lookup signatures: pass aLookupOptionsobject instead.- The variadic
parseUserAgents(...userAgents)form: pass an array instead.
All deprecated forms keep working in 7.x and behave identically (including cache
key compatibility between legacy options and their LookupOptions equivalents);
they will be removed in a future major version.
Migration
// Before (6.x) // After (7.x)
new IpregistryClient( new IpregistryClient({
new IpregistryConfigBuilder('KEY') apiKey: 'KEY',
.withEuBaseUrl() baseUrl: 'eu',
.withTimeout(10000) cache: new InMemoryCache(),
.build(), timeout: 10000,
new InMemoryCache()) })
client.lookupIp(ip, client.lookupIp(ip, {
IpregistryOptions.filter('location'), fields: 'location',
IpregistryOptions.hostname(true)) hostname: true,
})v6.2.0
Added
- Automatic splitting of large batch lookups, aligned with the Go client: inputs beyond the API limit (1024 values) are chunked and dispatched with bounded concurrency, preserving input order. Configurable via
withMaxBatchSizeandwithBatchConcurrency(default 4, set 1 for sequential dispatch). - New
DEFAULT_MAX_BATCH_SIZEconstant exposing the API per-request limit.
Changed
- Document timeout, retry, and batch configuration in the README.
v6.1.0
Added
- Configurable retry behavior aligned with the Go client:
withMaxRetries(default 3),withRetryInterval(exponential backoff base, default 1 second),withRetryOnServerError(default true) andwithRetryOnTooManyRequests(default false, honoring theRetry-Afterheader when enabled).
Changed
- Require Node.js 20+.
- Retry transient network errors and, by default, 5xx responses; previously only timeouts were retried.
- Replace the
lru-cachedependency with an internal implementation; the library now has zero runtime dependencies.
v6.0.2
Fixed
- Return
falsefromisErrorandisApiErrorfor non-object values instead of throwing aTypeError.
Changed
- Declare the package side-effect free to improve tree-shaking by bundlers.
- Expose
package.jsonthrough the packageexportsmap.
v6.0.1
Fixed
- Map request timeouts to a
ClientErrorwith message 'Request timed out'; a typo prevented the mapping from ever matching. - Send the current library version in the
user-agentheader instead of a hardcoded 4.0.0. - Percent-encode user-supplied values interpolated into API URL paths.
- Cache batch lookup results under the requested IP addresses and ASNs so that caching works when the
fieldsoption filters out theiporasnresponse fields. - Declare the
typescondition first in the packageexportsmap and provide format-specific type declarations so that TypeScript resolves them for both ESM and CommonJS consumers.
6.0.0
Changed
- Modify the library packaging to make ECMAScript modules (ESM) optional.
- Substitute the 'ky' dependency with native fetch API.
- Reduce the default timeout setting to 5 seconds.
- Implement retries, up to two times, with exponential backoff in the event of a timeout.
5.0.2
Added
- Add missing fields
sizeandstatusto type AutonomousSystemPrefix.
5.0.1
v5.0.0
Added
- New
IpregistryClient#batchLookupAsnsmethod. - New
IpregistryClient#lookupAsnmethod. - New
IpregistryClient#originLookupAsnmethod. - New
IpregistryConfigBuilder.withEuBaseUrlmethod. Once configured, requests will be handled by nodes deployed in the European Union only. - New
IpregistryRequestHandler#batchLookupAsnsmethod. - New
IpregistryRequestHandler#lookupAsnmethod. - New
IpregistryRequestHandler#originLookupAsnmethod.
Changed
- Rename
IpregistryClient#batchLookuptoIpregistryClient#batchLookupIps. - Rename
IpregistryClient#lookuptoIpregistryClient#lookupIp. - Rename
IpregistryClient#originLookuptoIpregistryClient#originLookupIp. - Rename
IpregistryClient#parsetoIpregistryClient#parseUserAgents. - Rename
IpregistryConfigBuilder.withApiUrltoIpregistryConfigBuilder.withBaseUrl. - Rename
IpregistryRequestHandler#batchLookuptoIpregistryRequestHandler#batchLookupIps. - Rename
IpregistryRequestHandler#lookuptoIpregistryRequestHandler#lookupIp. - Rename
IpregistryRequestHandler#originLookuptoIpregistryRequestHandler#originLookupIp. - Rename
IpregistryRequestHandler#parsetoIpregistryRequestHandler#parseUserAgents. - Rename utility class
UserAgenttoUserAgents. - Replace Axios by ky to bring support to Cloudflare Workers in addition to browser and NodeJS environments.
- Require NodeJS 18+.
Fixed
- Fixed origin requests returning wrong information when caching is enabled. Cache is now automatically disabled for
origin requests since it is incompatible.
v4.5.0
Added
- New
is_vpnfield insecurityobject.