@leicht.io/croncurrency
v0.0.2
Published
Node.js Wrapper around https://exchangeratesapi.io/ which ***is a free service for current and historical foreign exchange rates published by the European Central Bank.***
Downloads
2
Readme
CronCurrency
Node.js Wrapper around https://exchangeratesapi.io/ which is a free service for current and historical foreign exchange rates published by the European Central Bank.
This library makes it possible to get the values a single time via an Observable or infinite times using node-cron.
Install
npm install @leicht/[email protected]
Run Demo
npm run development
Build
npm run production
Usage
import {CronCurrency} from "../src/CronCurrency";
GET
import {CronCurrency} from "../src/CronCurrency";
new CronCurrency()
.base('DKK')
.with(['EUR', 'GBP', 'USD'])
.every("* * * * *") // Every minute. Remote this line to make a single request.
.subscribe(data => {
console.log('data', data);
// TODO: Save e.g. in DB
});