0.7.2 • Published 2 years ago

iso-country-currency v0.7.2

Weekly downloads
2,318
License
ISC
Repository
github
Last release
2 years ago

Installation

npm install iso-country-currency

Usage

Import package where you want and start using

Updates

Now has TS support!

v0.7.0

  • Croatian currency changed to Euro, thanks em-anas
  • Added currency numeric code, thanks Mrugesh Vaghela
  • Added JSDoc comment to TS types
  • Changed 'AU$' to '$' for Australia
  • Changed 'Rs' to '₹' for India
  • Changed 'TL' to '₺' for Turkey
  • Fixed for loops

v0.6.0

  • Added dateFormat to some countries

Documentation

getAllISOCodes()

Returns an array of all ISO codes and according data

getAllISOCodes()

{
    iso: "BE" 
    countryName: "Belgium",
    currency: "EUR",
    symbol: "€",
    dateFormat: "d/MM/yyyy",
    numericCode: 978
}

getAllInfoByISO(iso)

Returns an object with properties 'countryName', 'currency', 'symbol' and 'dateFormat'

getAllInfoByISO('BE')

{
    iso: "BE"
    countryName: "Belgium",
    currency: "EUR",
    symbol: "€",
    dateFormat: "d/MM/yyyy",
    numericCode: 978
}

getParamByISO(iso, param)

Returns param value for given ISO2

getParamByISO('BE', 'symbol')

getISOByParam(param, value)

Returns ISO2 code by given param value

getISOByParam('countryName', 'Belgium')

BE

getParamByParam(givenParam, givenParamValue, searchParam)

Returns search param value by given param value

getParamByParam('countryName', 'Belgium', 'currency')

EUR

getAllCountriesByCurrencyOrSymbol(param, value)

Returns array with all countries, that contain given param ('currency', 'symbol') with given value

getAllCountriesByCurrencyOrSymbol('currency', 'EUR')

["Belgium", "Saint Barthelemy", "Reunion", "Greece", ...]

getAllISOByCurrencyOrSymbol(param, value)

Returns array with all ISO2 codes, that contain given param ('currency', 'symbol') with given value

getAllISOByCurrencyOrSymbol('currency', 'EUR')

["BE", "BL", "RE", "GR", ...]

0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.0

3 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago