Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
money-converter
Advanced tools
A npm module that looks at mutliple exchanges when determining the fx rate
There are plenty of currency converter packages out there, each getting their conversion rates from different places. Money Converter looks at multiple sources to ensure that you always have the most accurate exchange rate avaialable. Its fast, simple, light weight and most importantly, fault resistant.
npm install money-converter
To make sure that money-converter is as fast as possible, you pass it in an array of currencies and a bse currency. money-converter will then load the conversion rate between your base currency and each of the other currencies. This async process must be completed before the module can be used
we're going to be using the popular async
module here for demonstation of how load the currencies before using them
make sure to include the base currency in the list of currencies you pass into the constructor
var MoneyConverter = require('monver-converter');
var async = require('async');
var money;
async.series([
// load and cache currency conversions
// the base currency is USD
function(done) {
money = new MoneyConverter('USD', ['CAD', 'GBP', 'EUR', 'USD'], done)
}
// example of how we want to actually use it
function(done) {
money.convert(1000, {from: 'USD', to: 'EUR'});
// => 914
money.convert(10, {from: 'CAD', to: 'EUR'});
// => 6.655501347120076
money.convert(1, {from: 'GBP', to: 'USD'});
// => 1.50534397109739
done();
}
]);
FAQs
A npm module that looks at mutliple exchanges when determining the fx rate
The npm package money-converter receives a total of 2 weekly downloads. As such, money-converter popularity was classified as not popular.
We found that money-converter 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.