exchangify
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Exchangify


My cool logo

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

Install

npm i exchangify

Example

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)

Functions

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'


Dependencies

None.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Package Sidebar

Install

npm i exchangify

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

82.7 kB

Total Files

27

Last publish

Collaborators

  • delavec