ecb-fx-rates
Simple and lightweight library for get current and historical fx rates.
Install
Node
npm install ecb-fx-rates --save
Usage
let getRatesFunc = ; let currencyName = 'JPY';let crossCurrencyName = 'JPY/BGN'; let historicalData = - 24 * 1000 * 60 * 60 * 24; //get fx rate for 24 days before
Promises examples
//Get historical data for cross-currency; //Get current data for currency;//or;
Callback examples
//Get historical data for cross-currency; //Get current data for currency;//or;
Description
Syntax
//JSDOC descriptions for common types /** * @typedef * @description ms of start of the day */ /** * @typedef {{}} fxRateOpts * @property * @property * @property * @property * @property */ /** * @callback GetFxRateCallback * @param * @param */ /** * @typedef */
//MAIN FUNCTION DESCRIPTION /** * Get foreign exchange rate * @param * @param * @returns Promise<number> */let getRatesFunc = ;
Test
Test
npm install
npm run test
Change list
Version 1.0.0
- Initial commit