Skip to content
Convert a country code ISO 3166-1 Alpha 3 to ISO 3166-1 Alpha 2
Branch: master
Clone or download
Latest commit bf826b5 Jan 19, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Init commit Jan 19, 2018
index.js Init commit Jan 19, 2018
package.json Init commit Jan 19, 2018
test.js Init commit Jan 19, 2018

README.md

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

You can’t perform that action at this time.