Skip to content
Node.js module to work with currency codes based on ISO 4217
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
README.md
data.js
index.js
package.json
test.js

README.md

currency-codes

A node.js module to list and work on currency codes based on the ISO 4217 standard.

npm install currency-codes

code('EUR')

var cc = require('currency-codes');
console.log(cc.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)

var cc = require('currency-codes');
console.log(cc.number(967));

/*
{
    code: 'ZMW',
    number: 967,
    digits: 2,
    currency: 'Zambian kwacha',
    countries: [ 'zambia' ] }
*/

country('colombia')

var cc = require('currency-codes');
console.log(cc.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()

var cc = require('currency-codes');
console.log(cc.codes());

/*
[
    'AED',
    'AFN',
    ...
    'ZAR',
    'ZMW'
]
*/

countries()

var cc = require('currency-codes');
console.log(cc.countries());

/*
[ 
    'united arab emirates',
    'afghanistan',
    ...
]
*/

License

MIT

Something went wrong with that request. Please try again.