Simple, 100% free and tiny JavaScript library for realtime currency conversion and exchange rate calculation, from any currency, to any currency.
exchangify is integrated with Croatian National Bank API.
NOTE: The exchange rate is in HRK
npm i exchangify
import { exchange } from "exchangify"
// convert EUR to HRK
const convertedAmount: number = await exchange(10, "EUR", "HRK")
// convert EUR to HRK with fixedRate
const convertedAmount: number = await exchange(amount, "HRK", "EUR", 7)
exchange(amount: number, from: string, to: string, fixedRate?: number): Promise<number>
amount: amount to convert
from: currency ISO 4217 standard
to: currency ISO 4217 standard
fixedRate?: used if you want to use fixed rate, leave empty instead
returns: converted amount
rates(): Promise<ExchangeRate[]>
returns: ExchangeRate[]
see ExchangeRate
rate(from: string, to:string): Promise<number>
from: currency ISO 4217 standard
to: currency ISO 4217 standard
returns: exchange rate for 'from' and 'to'
None.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Pavle Andrić, Eventrify Ltd.
This project is licensed under the MIT License - see the LICENSE.md file for details