Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

@types/geoip-lite

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/geoip-lite

TypeScript definitions for geoip-lite

ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
ts5.0
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
ts6.0
latest
Source
npmnpm
Version
1.4.4
Version published
Weekly downloads
232K
7.09%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/geoip-lite

Summary

This package contains type definitions for geoip-lite (https://github.com/bluesmoon/node-geoip).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geoip-lite.

index.d.ts

/**
 * https://github.com/bluesmoon/node-geoip#looking-up-an-ip-address
 */
export interface Lookup {
    /** [ <low bound of IP block>, <high bound of IP block> ] */
    range: [number, number];
    /** 2 letter ISO-3166-1 country code https://www.iban.com/country-codes */
    country: string;
    /**
     * Up to 3 alphanumeric variable length characters as ISO 3166-2 code
     * For US states this is the 2 letter state
     * For the United Kingdom this could be ENG as a country like “England
     * FIPS 10-4 subcountry code
     */
    region: string;
    /** 1 if the country is a member state of the European Union, 0 otherwise. */
    eu: "1" | "0";
    /** "Country/Zone" Timezone from IANA Time Zone Database */
    timezone: string;
    /** This is the full city name */
    city: string;
    /** The latitude and longitude of the city */
    ll: [number, number];
    /** Metro code */
    metro: number;
    /** The approximate accuracy radius (km), around the latitude and longitude */
    area: number;
}

export interface AsyncCallback {
    (err?: Error): void;
}

export type CmpArgs = number | [number];
export type CmpResult = 1 | -1 | 0 | null;

export function cmp(a: CmpArgs, b: CmpArgs): null | Lookup;
export function lookup(ip: string | number): null | Lookup;
export function pretty(ip: string | number | Array<string | number>): string;
export function startWatchingDataUpdate(cb?: AsyncCallback): void;
export function stopWatchingDataUpdate(): void;
export function clear(): void;
export function reloadData(cb?: AsyncCallback): void;
export function reloadDataSync(): void;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by Yuce Tekol, Artem, and Piotr Błażejewicz.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts