@leicht.io/croncurrency
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @leicht.io/croncurrency

Weekly Downloads

0

Version

0.0.2

License

ISC

Unpacked Size

28.4 kB

Total Files

19

Last publish

Collaborators

  • leicht.io