iso-country-map

1.0.2 • Public • Published

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

npm install iso-country-map

Usage

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

Get ISO Alpha 2 value for a given country name

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

Get ISO Alpha 3 value for a given country name

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

Get a country name for a given ISO code

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


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

Development

Clone repository

git clone https://github.com/markogrady1/iso-country-map.git

Run tests

npm run test

Run eslint

npm run tidy

Package Sidebar

Install

npm i iso-country-map

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

26.4 kB

Total Files

5

Last publish

Collaborators

  • markogrady1