0.0.2 • Published 5 years ago

@leicht.io/croncurrency v0.0.2

Weekly downloads
2
License
ISC
Repository
-
Last release
5 years ago

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/croncurrency@0.0.1

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
});