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

Package detail

language-country-code

bugra-isik45MIT1.0.5TypeScript support: included

A library to convert language codes to country codes and vice versa.

language, country, code, country-code, language-code, npm, country-to-language, language-to-country, localization, internationalization, i18n, geolocation, language-mapping, region-code, iso-codes

readme

import { getCountryCode, getLanguageCode } from "language-country-code"

const countryCode = getCountryCode("en") // "US"
const languageCode = getLanguageCode("US") // "en"