
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
currency-codes
Advanced tools
A node.js module to list and work on currency codes based on the ISO 4217 standard.
npm install currency-codes
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' ]
}
*/
var cc = require('currency-codes');
console.log(cc.number(967));
/*
{
code: 'ZMW',
number: 967,
digits: 2,
currency: 'Zambian kwacha',
countries: [ 'zambia' ] }
*/
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' ]
}
]
*/
var cc = require('currency-codes');
console.log(cc.codes());
/*
[
'AED',
'AFN',
...
'ZAR',
'ZMW'
]
*/
var cc = require('currency-codes');
console.log(cc.numbers());
/*
[
'784',
'971',
...
'710',
'967'
]
*/
var cc = require('currency-codes');
console.log(cc.countries());
/*
[
'united arab emirates',
'afghanistan',
...
]
*/
var data = require('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']
}, {
...
*/
var cc = require('currency-codes');
console.log(cc.publishDate);
/*
2024-06-25
*/
Fetch the latest copy of ISO-4217 from the maintainer and update this library's currency data file.
$ npm run iso
> currency-codes@2.1.0 iso
> npm run iso:fetch-xml && npm run iso:ingest-xml
> currency-codes@2.1.0 iso:fetch-xml
> node scripts/fetch-iso-4217-xml.js
Downloaded https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml to iso-4217-list-one.xml
> currency-codes@2.1.0 iso:ingest-xml
> node scripts/ingest-iso-4217-xml.js
Ingested iso-4217-list-one.xml into data.js
Wrote publish date to iso-4217-publish-date.js
Note: You may have to manually tweak the capitalization of some country's names.
MIT
The iso-currency package provides similar functionality to currency-codes, offering ISO 4217 currency codes and related information. It allows for lookups by code, number, and country, similar to currency-codes.
The currency-formatter package focuses on formatting currency values but also includes currency code information. It is useful if you need both currency code data and formatting capabilities.
The currency-symbol-map package provides a mapping of currency codes to their symbols. While it does not offer as comprehensive data as currency-codes, it is useful for quickly retrieving currency symbols.
FAQs
Lookup currency codes based on ISO 4217
The npm package currency-codes receives a total of 319,705 weekly downloads. As such, currency-codes popularity was classified as popular.
We found that currency-codes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.