Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

country-iso-3-to-2

vtex144.9kMIT1.1.1

Convert a country code ISO 3166-1 Alpha-3 to ISO 3166-1 Alpha-2

country, code, country, iso, alpha-3, alpha, 3, alpha-2, alpha, 2, 3166

readme

country-iso-3-to-2

Convert a country code ISO 3166-1 Alpha-3 to ISO 3166-1 Alpha-2

Install

$ npm install country-iso-3-to-2

Usage

const getCountryISO2 = require("country-iso-3-to-2");

getCountryISO2("BRA")
// "BR"

getCountryISO2("USA")
// "US"

API

getCountryISO2(countryCode)

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

Return: A string with the country code in ISO 3166-1 Alpha-2


License

MIT © VTEX