Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iso-country-currency

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iso-country-currency

Get country name, currency and currency symbol via ISO2 country abbreviation

  • 0.7.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12K
decreased by-8.31%
Maintainers
1
Weekly downloads
 
Created
Source

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", ...]

Keywords

FAQs

Package last updated on 18 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc