# @types/geoip-lite

> TypeScript definitions for geoip-lite

Latest version **1.4.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/geoip-lite
pnpm add @types/geoip-lite
yarn add @types/geoip-lite
bun add @types/geoip-lite
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.4.4 |
| Published | 2023-11-07 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51443 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/geoip-lite
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geoip-lite
- npm.io page: https://npm.io/package/@types/geoip-lite

## Recent versions

- 1.4.4 (latest) — 2023-11-07
- 1.4.1 (ts3.3) — 2020-12-30
- 1.4.0 (ts3.2) — 2020-09-25
- 1.1.31 (ts2.8) — 2020-04-02
- 1.1.29 (ts2.0) — 2016-09-19
- 1.4.3 — 2023-10-18
- 1.4.2 — 2023-09-20
- 1.1.30 — 2020-02-12
- 1.1.28 — 2016-07-14
- 1.1.27-alpha — 2016-07-08
- 1.1.26-alpha — 2016-07-04
- 1.1.25-alpha — 2016-07-02
- 1.1.24-alpha — 2016-07-01
- 1.1.23-alpha — 2016-07-01
- 1.1.22-alpha — 2016-05-25
- … 3 more at https://npm.io/package/@types/geoip-lite/versions

## README

# 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/DefinitelyTyped/DefinitelyTyped/tree/master/types/geoip-lite/index.d.ts)
````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](https://github.com/yuce), [Artem](https://github.com/witem), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).

---
_Source: https://npm.io/package/@types/geoip-lite · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
