Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
currency-codes
Advanced tools
The currency-codes npm package provides a comprehensive list of currency codes and related information based on the ISO 4217 standard. It allows users to look up currency codes, names, and other related data.
Get currency by code
This feature allows you to retrieve information about a currency using its code. For example, 'USD' will return details about the US Dollar.
const currencyCodes = require('currency-codes');
const currency = currencyCodes.code('USD');
console.log(currency);
Get currency by number
This feature allows you to retrieve information about a currency using its numeric code. For example, '840' will return details about the US Dollar.
const currencyCodes = require('currency-codes');
const currency = currencyCodes.number('840');
console.log(currency);
Get currency by countries
This feature allows you to retrieve a list of currencies used in a specific country. For example, 'United States' will return the US Dollar.
const currencyCodes = require('currency-codes');
const currencies = currencyCodes.countries('United States');
console.log(currencies);
Get all currency codes
This feature allows you to retrieve a list of all currency codes available in the package.
const currencyCodes = require('currency-codes');
const allCurrencies = currencyCodes.codes();
console.log(allCurrencies);
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.
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.countries());
/*
[
'united arab emirates',
'afghanistan',
...
]
*/
FAQs
Lookup currency codes based on ISO 4217
The npm package currency-codes receives a total of 201,330 weekly downloads. As such, currency-codes popularity was classified as popular.
We found that currency-codes demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.