I need a package for converting a code like US into United States. I found country-locale-map, but it only supports converting code into international name.

For example, I need to convert BR into Brasil. The NPM package country-locale-map only outputs Brazil (the international form).

1 Answer 1


The ECMA-402 standard defines Intl.DisplayNames, so no NPM package needed as that is already supported in NodeJS built-ins. Here's an example from developer.mozilla.org:

const regionNamesInEnglish = new Intl.DisplayNames(['en'], { type: 'region' });
const regionNamesInTraditionalChinese = new Intl.DisplayNames(['zh-Hant'], { type: 'region' });

// Expected output: "United States"

// Expected output: "美國"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.