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-rates-store
Advanced tools
A storage bot to sync exchange rates with any exchange rates api
const CurrStore = require('currency-rates-store');
const pull = require('currency-restapi-currencylayer').Live('YOUR_ACCESS_KEY');
// Default on `USD`, and 3 hours between requests
var store = CurrStore({pull: pull});
// CurrencyRatesStore is an EventEmitter,
['error', 'warn', 'info'].forEach(lv=> store.on(lv, e=> console.log(e)));
store.on('load', store=>{
// convert €100 EUR to USD
console.log(store.convert(100).from('EUR').to('USD'));
// convert € 1 EUR to USD
console.log(store.from('EUR').to('CAD'));
// or skip `.from()`, if the `store.base` is `USD`
console.log(store.convert(100).to('EUR'));
// simply pass the pair
console.log(store.pair('EURUSD'));
// or pass the symbol one by one
console.log(store.rate('USD', 'EUR'));
// same as above, if the exchange rates storage is based on `USD`
console.log(store.rate('EUR'));
});
pull
: An async function. it should callback the latest rates in the following structure. Usually, it wraps exchange rates sites api. Following are modules designed for currency-rates-store
base
: 'USD|EUR|GBP...'. which currency this rates should be based on. Default: USD
wait
: refresh in milliseconds. Default to 3 hours
between refreshs. minimum 10 minutes. However, if any error occurred from pull
callback, it will use util-retry
to retry the pull
3 times.
{
base: 'USD|EUR|GBP' - tell which currency this rates is based on
rates: {
USD: 1, - If base == 'USD', this value should be 1
GBP: ...
EUR: ...
...
},
ts: {Milliseconds}
}
function (store) { }
Emitted when the first valid rates is recieved
function (error) { }
See source code
function (msg) {}
Emitted when the received rates is based on another currency which is different from base
property configured on this store. A rebase calculation will happen, and emit this warning
.
function (info) {}
Emitted for logging purpose.
FAQs
A storage bot which sync exchange rates
The npm package currency-rates-store receives a total of 0 weekly downloads. As such, currency-rates-store popularity was classified as not popular.
We found that currency-rates-store 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’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.