npm install iso-country-data-currency
Import package where you want and start using
Now has TS support!
Returns an array of all ISO codes and according data
getAllISOCodes()
{
iso: "BE"
countryName: "Belgium",
currency: "EUR",
symbol: "€"
}
Returns an object with properties 'countryName', 'currency' and 'symbol'
getAllInfoByISO('BE')
{
iso: "BE"
countryName: "Belgium",
currency: "EUR",
symbol: "€"
}
Returns param value for given ISO2
getParamByISO('BE', 'symbol')
€
Returns ISO2 code by given param value
getISOByParam('countryName', 'Belgium')
BE
Returns search param value by given param value
getParamByParam('countryName', 'Belgium', 'currency')
EUR
Returns array with all countries, that contain given param ('currency', 'symbol') with given value
getAllCountriesByCurrencyOrSymbol('currency', 'EUR')
["Belgium", "Saint Barthelemy", "Reunion", "Greece", ...]
Returns array with all ISO2 codes, that contain given param ('currency', 'symbol') with given value
getAllISOByCurrencyOrSymbol('currency', 'EUR')
["BE", "BL", "RE", "GR", ...]