Skip to content

Small library for getting currency names by currency code(s). Names available on Russian and English. 184 currency codes in total.

Notifications You must be signed in to change notification settings

alcovegan/currency-names

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

I made this package for working with countries data by mledoze. They are using arrays with ISO 4217 currency codes, so, using my package you can convert them to string with their names. Names available on Russian and English. Codes and named taken from Wikipedia.

Installation

npm install currency-codes-ru-en-names

or

yarn add currency-codes-ru-en-names

Documentation

var currency = require('currency-codes-ru-en-names');

currency.names(code<String|Array>, [locale<String>]);
// code can be single string or flat array of 3-letter codes
// if locale not specified, then "ru" will be used

// with single string
currency.names("XCD", "ru");
// "Восточно-карибский доллар"

// with single string
currency.names("XCD", "en");
// "East Caribbean Dollar"

// with an array (single item)
currency.names(["XCD"], "ru");
// "Восточно-карибский доллар"

// with an array (multiple items)
currency.names(["USD", "USN", "USS"], "ru");
// "Доллар США, Доллар следующего дня, Доллар того же дня"

// with an array (multiple items)
currency.names(["USD", "USN", "USS"], "en");
// "US Dollar, US Dollar (Next day), US Dollar (Same day)"

Tests

npm run test

Todo

  • Add npm and yarn install commands in README
  • Add countries (their ISO 639-3 codes) using this currency to every code
  • Add custom delimeter for output strings
  • Support for input data as delimited string with choise for delimeter
  • Making it work in browsers

About

Small library for getting currency names by currency code(s). Names available on Russian and English. 184 currency codes in total.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published