es6-currency-codes
v2.0.1
Published
Lookup currency codes based on ISO 4217 in pure es6
Downloads
10
Maintainers
Readme
es6-currency-codes
A node.js module to list and work on currency codes based on the ISO 4217 standard.
npm install es6-currency-codes
This is a es6 conversion, based on https://github.com/freeall/currency-codes
code('EUR')
var cc = require('currency-codes');
import { code } from 'currency-codes'
console.log(code('EUR'));
/*
{
code: 'EUR',
number: 978,
digits: 2,
currency: 'Euro',
countries: [
'andorra', 'austria', 'belgium', 'cyprus', 'estonia', 'finland',
'france', 'germany', 'greece', 'ireland', 'italy', 'kosovo',
'luxembourg', 'malta', 'monaco', 'montenegro', 'netherlands',
'portugal', 'san marino', 'slovakia', 'slovenia', 'spain',
'vatican city' ]
}
*/
number(967)
import { number } from 'currency-codes'
console.log(number(967));
/*
{
code: 'ZMW',
number: 967,
digits: 2,
currency: 'Zambian kwacha',
countries: [ 'zambia' ] }
*/
country('colombia')
import { country } from 'currency-codes'
console.log(country('colombia'));
/*
[
{
code: 'COP',
number: 170,
digits: 2,
currency: 'Colombian peso',
countries: [ 'colombia' ]
}, {
code: 'COU',
number: 970,
digits: 2,
currency: 'Unidad de Valor Real',
countries: [ 'colombia' ]
}
]
*/
codes()
import { codes } from 'currency-codes'
console.log(codes());
/*
[
'AED',
'AFN',
...
'ZAR',
'ZMW'
]
*/
numbers()
import { numbers } from 'currency-codes'
console.log(numbers());
/*
[
'784',
'971',
...
'710',
'967'
]
*/
countries()
import { countries } from 'currency-codes'
console.log(countries());
/*
[
'united arab emirates',
'afghanistan',
...
]
*/
data
import {data} 'currency-codes/data'
console.log(data);
/*
[{
code: 'AED',
number: '784',
digits: 2,
currency: 'United Arab Emirates dirham',
countries: ['united arab emirates']
}, {
code: 'AFN',
number: '971',
digits: 2,
currency: 'Afghan afghani',
countries: ['afghanistan']
}, {
...
*/
License
MIT