# iso-3166-1

> Lookup information with ISO 3166-1 alpha-2, ISO 3166-1 alpha-3 and ISO 3166-1 numeric

Latest version **2.1.1** (published 2021-10-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2021-10-08 |
| First published | 2016-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 37.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 60 |
| Author | Daniel Eckermann |
| Maintainers | ecrmnn |
| Keywords | iso-3166, ISO 3166-1, ISO 3166-1 alpha-2, ISO 3166-1 alpha-3, ISO 3166-1 numeric, alpha-2, alpha-3, ISO, lookup, country, countries, geo |

## Links

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

## Recent versions

- 2.1.1 (latest) — 2021-10-08
- 2.1.0 — 2021-09-14
- 2.0.1 — 2020-07-15
- 2.0.0 — 2020-07-15
- 1.1.1 — 2020-07-15
- 1.1.0 — 2017-07-12
- 1.0.1 — 2016-03-11
- 1.0.0 — 2016-03-09

## README

# iso-3166-1
> Lookup information with ISO 3166-1 alpha-2, ISO 3166-1 alpha-3 and ISO 3166-1 numeric

[![Build Status](https://travis-ci.org/ecrmnn/iso-3166-1.svg?branch=master)](https://travis-ci.org/ecrmnn/iso-3166-1)
[![npm version](https://img.shields.io/npm/v/iso-3166-1.svg)](http://badge.fury.io/js/iso-3166-1)
[![npm version](https://img.shields.io/npm/dm/iso-3166-1.svg)](http://badge.fury.io/js/iso-3166-1)
[![npm version](https://img.shields.io/npm/l/iso-3166-1.svg)](http://badge.fury.io/js/iso-3166-1)

### Installation
```bash
npm install iso-3166-1 --save
```

### Usage
Get country by ISO 3166-1 Alpha-2
```javascript
const iso = require('iso-3166-1');

console.log(iso.whereAlpha2('no'));
/** Returns:
  {
    country: 'Norway',
    alpha2: 'NO',
    alpha3: 'NOR',
    numeric: '578'
  }
*/
```

Get country by ISO 3166-1 Alpha-3
```javascript
const iso = require('iso-3166-1');

console.log(iso.whereAlpha3('nor'));
/** Returns:
  {
    country: 'Norway',
    alpha2: 'NO',
    alpha3: 'NOR',
    numeric: '578'
  }
*/
```

Get country by ISO 3166-1 Numeric
```javascript
const iso = require('iso-3166-1');

console.log(iso.whereNumeric(578));
/** Returns:
  {
    country: 'Norway',
    alpha2: 'NO',
    alpha3: 'NOR',
    numeric: '578'
  }
*/
```

Get country by country name
```javascript
const iso = require('iso-3166-1');

console.log(iso.whereCountry('NORWAY'));
/** Returns:
  {
    country: 'Norway',
    alpha2: 'NO',
    alpha3: 'NOR',
    numeric: '578'
  }
*/
```

Get all countries
```javascript
const iso = require('iso-3166-1');

console.log(iso.all());
/** Returns:
  [
    {
      country: 'Norway',
      alpha2: 'NO',
      alpha3: 'NOR',
      numeric: '578'
    }
  ]
*/
```

### License
MIT © [Daniel Eckermann](http://danieleckermann.com)

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