# @types/geoip-country

> TypeScript definitions for geoip-country

Latest version **5.0.0** (published 2025-10-27) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 65/100 (B)** — status: stable.

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2025-10-27 |
| First published | 2020-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51444 |
| Maintainers | types |

## Links

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

## Recent versions

- 5.0.0 (latest) — 2025-10-27
- 4.0.2 (ts4.5) — 2023-11-07
- 4.0.0 (ts3.2) — 2020-10-17
- 4.0.1 — 2023-10-18

## README

# Installation
> `npm install --save @types/geoip-country`

# Summary
This package contains type definitions for geoip-country (https://github.com/sapics/geoip-country).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geoip-country.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geoip-country/index.d.ts)
````ts
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;
    /** Full country name */
    name?: string;
    /** Native country name */
    native?: string;
    /** Full capital name */
    capital?: string;
    continent?: "AF" | "AN" | "AS" | "EU" | "NA" | "OC" | "SA";
    continent_name?: "Africa" | "Antarctica" | "Asia" | "Europe" | "North America" | "Oceania" | "South America";
    /** ISO 639-1 2 letter language codes */
    languages?: string[];
    /** ISO 4217 currency codes */
    currency?: string[];
    /** Phone number prefixes */
    phone?: string[];
}

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

export function cmp(a: CmpArgs, b: CmpArgs): null | Lookup;
/**
 * @param ip ipv4, ipv6 or "dual stack" IP (e.g. `"::ffff:8.8.8.8"`)
 *
 * @returns null for local IPs and unknown IP ranges, otherwise an object with country info
 */
export function lookup(ip: string | number): null | Lookup;
export function pretty(ip: string | number | Array<string | number>): string;
export function startWatchingDataUpdate(cb?: (err?: Error) => void): void;
export function stopWatchingDataUpdate(): void;

````

### Additional Details
 * Last updated: Mon, 27 Oct 2025 21:32:46 GMT
 * Dependencies: none

# Credits
These definitions were written by [Jesse Chan](https://github.com/jesec).

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