currencyexchanges

1.1.1Β β€’Β PublicΒ β€’Β Published

πŸ’° A simple exchange rate API for Node.js

GitHub package.json version NPM package version

node-exchangerate is a JavaScript wrapper providing daily Forex currency exchange data, via arzzen's exchangerate.host. It is compatible with Node.js, the browser, and React Native.

βž• Install

Node (yarn and npm)

# Yarn
> yarn add currencyexchanges

# NPM
> npm i currencyexchanges

Browser

<!-- browser and minified browser files are in dist/, download or use a Git file mirror to the raw file -->
<!-- you can also use an npm cdn pointing to dist/currencyexchanges-browser-min.js with 1.1.0+ -->
<script src="/path/to/currencyexchanges-browser.js"></script>

πŸ’½ Usage

Node

const NodeExr = require("currencyexchanges");
const ExchangeRate = new NodeExr({ primaryCurrency: "GBP" });

(async function () {
    await ExchangeRate.getExchangeRate("AUD", "GBP").then(console.log);
})();

Browser

<script src="/path/to/currencyexchanges-browser.js"></script>
<script>
    const ExchangeRates = new NodeExr({ primaryCurrency: "GBP" });
    ExchangeRates.getExchangeRate("EUR").then(result => console.log(result));
</script>

βœ”οΈ Features

  • πŸ’° Daily exchange rates for both single and multiple currencies
  • ⏰ Historical exchange rates between two time periods
  • πŸ“ˆ Daily fluctuation data exchange rates (start and end rates, percentages for change, etc.)

πŸ“š Documentation

  • The index.js file is extremely simple and the comments will help you understand what each function does

  • When developing with node-exchangerate in supported IDEs, the comments from the index.js file are interpreted by JSDoc to generate notes and documentation regarding functions and their parameters

  • The example file demonstrates each function with an explanation, an example usage of the function, and its' output (in the comments) of the file.

To-do

  • [x] Fluctuations

  • [x] Basic TypeScript configuration

  • [ ] Rewrite in TypeScript

  • [ ] Use ES instead of CommonJS for module source code

  • [ ] Add ES/CommonJS inoperability

Package Sidebar

Install

npm i currencyexchanges

Weekly Downloads

2

Version

1.1.1

License

GPL-3.0-or-later

Unpacked Size

89 kB

Total Files

15

Last publish

Collaborators

  • dannyyisepic