Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@prygun/currency-converter
Advanced tools
A module for converting currency using the OpenExchangeRates API.
Readme
This is a module for converting currency using the OpenExchangeRates API. It provides a simple interface for converting between various currencies based on current exchange rates.
To install this module, run the following command:
npm install @prygun/currency-converter
Before using the CurrencyConverter class, you need to obtain an App ID from OpenExchangeRates. To get an App ID, follow these steps:
To use the CurrencyConverter class, import it and create a new instance with your OpenExchangeRates App ID as the constructor parameter:
import { CurrencyConverter } from '@prygun/currency-converter';
const converter = new CurrencyConverter('YOUR_OPEN_EXCHANGE_RATES_APP_ID');
Then, call the convert method with the desired parameters:
const convertedAmount = await converter.convert('USD', 'EUR', 10);
console.log(convertedAmount); // 9.41
By default, the convert method rounds the converted amount to 2 decimal places. You can override this by passing a fourth parameter to the method:
const convertedAmount = await converter.convert('USD', 'EUR', 10, 4);
console.log(convertedAmount); // 9.4081
The convert
method accepts four parameters:
fromCurrency
- The currency code to convert from.toCurrency
- The currency code to convert to.amount
- The amount to convert.round
(optional) - The number of decimal places to round the converted amount to. Defaults to 2
if not specified.This module is licensed under the ISC License. See the LICENSE file for details.
This module was developed with the support of ChatGPT, an AI language model created by OpenAI.
FAQs
A module for converting currency using the OpenExchangeRates API.
The npm package @prygun/currency-converter receives a total of 83 weekly downloads. As such, @prygun/currency-converter popularity was classified as not popular.
We found that @prygun/currency-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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.