node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »

cbr-rates

cbr-rates Build Status

Get currency rates from Central Bank of Russia

cbr-rates-cli - CLI for this module.

Install

npm install --save cbr-rates

Usage

import cbrRates from 'cbr-rates';
 
cbrRates().then(rates => {
  console.log(rates.usd); // {par: ..., value: ...} 
});
 
cbrRates(new Date()).then(rates => {
  console.log(rates.usd); // {par: ..., value: ...} 
});

API

cbrRates([date])

Return a promise that resolves to last currency rates or rates for specified date.

date

Type: date
Default: new Date()

Date for which to get rates.

License

MIT