Skip to content

Convert ISO 3166-1 Alpha-2, ISO 3166-1 Alpha-2 and IOC country codes

License

Notifications You must be signed in to change notification settings

remyvanlerberghe/convert-country-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

convert-country-codes

Convert ISO 3166-1 Alpha-2, ISO 3166-1 Alpha-3 and IOC country codes

Install

$ npm install convert-country-codes

or

$ yarn add convert-country-codes

Usage

const {
  convertIocCode,
  convertIso2Code,
  convertIso3Code
} = require("convert-country-codes");

convertIocCode("BRA");
// { iso2: 'BR', iso3: 'BRA' }

convertIso2Code("BR");
// { ioc: 'BRA', iso3: 'BRA' }

convertIso3Code("BRA");
// { ioc: 'BRA', iso2: 'BR' }

API

convertIocCode(iocCode)

Parameter: A string with an IOC country code

Returns: An object with the corresponding ISO 3166-1 Alpha-2 and ISO 3166-1 Alpha-3 country codes

convertIso2Code(iso2Code)

Parameter: A string with an ISO 3166-1 Alpha-2 country code

Returns: An object with the corresponding IOC and ISO 3166-1 Alpha-3 country codes

convertIso3Code(iso3Code)

Parameter: A string with an ISO 3166-1 Alpha-3 country code

Returns: An object with the corresponding IOC and ISO 3166-1 Alpha-2 country codes


License

MIT ©

About

Convert ISO 3166-1 Alpha-2, ISO 3166-1 Alpha-2 and IOC country codes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published