UNPKG

@maxmind/geoip2-node

Version:

Node.js API for GeoIP2 webservice client and database reader

20 lines (19 loc) 625 B
import * as models from './models/index.js'; export interface WebServiceClientOptions { fetcher?: typeof fetch; host?: string; timeout?: number; } export default class WebServiceClient { private accountID; private licenseKey; private timeout; private host; private fetcher; constructor(accountID: string, licenseKey: string, options?: WebServiceClientOptions | number); city(ipAddress: string): Promise<models.City>; country(ipAddress: string): Promise<models.Country>; insights(ipAddress: string): Promise<models.Insights>; private responseFor; private handleError; }