# exchangify

Latest version **1.0.1** (published 2020-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install exchangify
pnpm add exchangify
yarn add exchangify
bun add exchangify
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-03-02 |
| First published | 2018-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 80.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Eventrify Ltd. |
| Maintainers | delavec |
| Keywords | currency, currencies, currency, conversion |

## Links

- npm: https://www.npmjs.com/package/exchangify
- Repository: https://github.com/eventrifydev/exchangify
- Homepage: https://github.com/eventrifydev/exchangify#readme
- Issues: https://github.com/eventrifydev/exchangify/issues
- npm.io page: https://npm.io/package/exchangify

## Recent versions

- 1.0.1 (latest) — 2020-03-02
- 1.0.0 — 2020-02-26
- 0.9.8 — 2020-02-21
- 0.9.7 — 2019-12-19
- 0.9.5 — 2019-12-17
- 0.9.4 — 2019-12-17
- 0.9.3 — 2019-12-17
- 0.9.2 — 2019-12-17
- 0.9.1 — 2019-12-17
- 0.9.0 — 2019-12-17
- 0.2.2 — 2019-02-27
- 0.2.1 — 2019-02-27
- 0.2.0 — 2019-02-27
- 0.1.8 — 2018-05-24
- 0.1.7 — 2018-05-19
- … 7 more at https://npm.io/package/exchangify/versions

## README

# Exchangify

<br/>
<img src="https://res.cloudinary.com/disqnsnwa/image/upload/v1526634764/exchangify_logo.png" alt="My cool logo" width="200" height="200" />
<br/>

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](https://api.hnb.hr/). 

**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<br>
**from**: currency ISO 4217 standard<br>
**to**: currency ISO 4217 standard<br>
**fixedRate?**: used if you want to use fixed rate, leave empty instead<br>
**returns**: converted amount <br>
<br><br>
```
rates(): Promise<ExchangeRate[]>
```
**returns**: ExchangeRate[]

see [ExchangeRate](https://github.com/eventrifydev/exchangify/blob/master/src/ExchangeRate.ts)
<br><br>
```
rate(from: string, to:string): Promise<number>
```
**from**: currency ISO 4217 standard<br>
**to**: currency ISO 4217 standard<br>
**returns**: exchange rate for 'from' and 'to'<br>
<br>
<br>
### Dependencies
None.

## Contributing

Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.


## Authors

* **Pavle Andrić, [Eventrify Ltd.](https://get2.events)**

## License

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

---
_Source: https://npm.io/package/exchangify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
