# iso-3166-1-alpha-2

> Simple module providing ISO-3166-1-alpha-2 country code to english country name lookup and reverse lookup

Latest version **1.0.2** (published 2024-03-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install iso-3166-1-alpha-2
pnpm add iso-3166-1-alpha-2
yarn add iso-3166-1-alpha-2
bun add iso-3166-1-alpha-2
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-03-30 |
| First published | 2015-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/iso-3166-1-alpha-2) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Georg Zoeller |
| Maintainers | georgzoeller |
| Keywords | iso-3166-1-alpha-2, iso-3166-1, country, country code, countries, name |

## Links

- npm: https://www.npmjs.com/package/iso-3166-1-alpha-2
- Repository: https://github.com/georgzoeller/iso-3166-1-alpha-2
- Issues: https://github.com/georgzoeller/iso-3166-1-alpha-2/issues
- npm.io page: https://npm.io/package/iso-3166-1-alpha-2

## Dependencies (1)

- [mout](https://npm.io/package/mout.md) ^1.2.4

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2024-03-30
- 1.0.1 — 2023-01-18
- 1.0.0 — 2015-01-29

## README

#Iso-3155-1-alpha-2  [![](https://travis-ci.org/georgzoeller/iso-3166-1-alpha-2.svg?branch=master)](https://travis-ci.org/georgzoeller/iso-3166-1-alpha-2) [![](https://img.shields.io/npm/v/iso-3166-1-alpha-2.svg?style=flat)](https://www.npmjs.com/package/iso-3166-1-alpha-2)


Simple lookup interface for iso country codes to countries and reverse.


The only dependency is mout, so this module works both in node and in the browser(ify).

## Installation

    npm install iso-3166-1-alpha-2

## Usage

    var iso3311a2 = require('./iso-3166-1-alpha-2')

    // Lookup country by code
    console.log iso3311a2.getCountry("DE")    // "Germany"

    // Lookup code by country
    console.log iso3311a2.getCode("Germany")  // "DE"

    // Get array of all country codes
    console.log iso3311a2.getCodes()          // ["AF","AX","AL",...]

    // Get array of all country names
    console.log iso3311a2.getCountries()      // ["Afghanistan","Åland Islands","Albania",...]

    // Get Object with code (key) to country (value) mappings
    console.log iso3311a2.getData()           // { "AF" : "Afghanistan", .... }


## Documentation

    Docco annotated source is found here: (docs/index.html)

---
_Source: https://npm.io/package/iso-3166-1-alpha-2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
