# iso-country-map

> Switch country name for ISO code and vice versa

Latest version **1.0.2** (published 2021-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install iso-country-map
pnpm add iso-country-map
yarn add iso-country-map
bun add iso-country-map
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-03-31 |
| First published | 2021-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 25.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mark O Grady |
| Maintainers | markogrady1 |
| Keywords | iso, iso-country, country-iso, ISO-3166, ISO3166, country, country-code, country code, iso code |

## Links

- npm: https://www.npmjs.com/package/iso-country-map
- Repository: https://github.com/markogrady1/iso-country-map
- Homepage: https://github.com/markogrady1/iso-country-map#readme
- Issues: https://github.com/markogrady1/iso-country-map/issues
- npm.io page: https://npm.io/package/iso-country-map

## Recent versions

- 1.0.2 (latest) — 2021-03-31
- 1.0.1 — 2021-03-30
- 1.0.0 — 2021-03-30

## README

# iso-country-map

Get an ISO (Alpha 2 or Alpha 3) code for a given country name, or get a country name for a given ISO code (Alpha 2 or Alpha 3).


### Installation

```shell
npm install iso-country-map
```


### Usage

```js
const isoCountry = require('iso-country-map');
```

Get ISO Alpha 2 value for a given country name

```js
isoCountry('Canada', 'iso2'); // RESULT: CA
```

Get ISO Alpha 3 value for a given country name

```js
isoCountry('Canada', 'iso3'); // RESULT: CAN
```


Get a country name for a given ISO code

```js
isoCountry('CA', 'name'); // RESULT: Canada


isoCountry('CAN', 'name'); // RESULT: Canada
```

### Development

Clone repository

```shell
git clone https://github.com/markogrady1/iso-country-map.git
```
Run tests

```shell
npm run test
```
Run eslint

```shell
npm run tidy
```

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