
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@public-js/exchange-rates
Advanced tools
An extensive exchange rates API client supporting multiple services for best results
An extensive exchange rates API client supporting multiple services for best results
Add the package to your project by running:
npm i @public-js/exchange-rates
Instantiate a class:
import { ExchangeRates } from '@public-js/exchange-rates';
const service = await new ExchangeRates({
OpenexchangeratesOrg: env.OXR_API_KEY,
ExchangerateHost: true,
});
Fetch the latest rates:
const rates = await service.getRates('USD', ['EUR', 'CNY']);
console.log(rates); // {"CNY":6.8936,"EUR":0.901185}
Fetch the historical rates:
const rates = await service.getRates('USD', ['EUR', 'CNY'], '2023-01-15');
console.log(rates); // {"CNY":6.8936,"EUR":0.901185}
OpenexchangeratesOrg
– has a limited free planExchangeratesapiIo
– has a limited free planCurrencyapiCom
– has a limited free planExchangerateHost
– free to use, accepts donationsExchangerateApiCom
– has a limited free planNote The majority of services require an API key/token to work. This doesn't apply to ExchangerateHost, which needs any truthy value provided as a key to be active.
When the ExchangeRates
class is instantiated it requires a configuration object to be provided.
The said object has to list the desired services and their respective API keys/tokens.
Since some of the services don't handle unsupported currency codes well, they will be queried for a full rates list which then gets filtered out. This process is repeated for each service until all of them are queried or the required currencies are fetched.
The order of the services is listed in the "Supported services" section, it can't be altered at a time and is pre-defined based on data reliability, precision and currency coverage. It is possible however to enable only part of the supported services by providing only some of the API keys.
MIT, full license text. Read more about it on TLDRLegal.
FAQs
An extensive exchange rates API client supporting multiple services for best results
The npm package @public-js/exchange-rates receives a total of 4 weekly downloads. As such, @public-js/exchange-rates popularity was classified as not popular.
We found that @public-js/exchange-rates 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.