nbrb-currency

1.1.0 • Public • Published

nbrb-currency

NPM version

Returns exchange rates of the National Bank of the Republic of Belarus.

npm i -S nbrb-currency

Getting currency rates for today

var currency = require('nbrb-currency');
 
currency(function(err, data) {
    var rate = data.currencies.find(function (item) {
        return item.charCode === 'USD';
    }).rate;
 
    console.log(rate); //it will print rate for USD for current date
});

Getting currency rates for specific date

var currency = require('nbrb-currency');
 
currency('12/24/2014', function(err, data) {
    var rate = data.currencies.find(function (item) {
        return item.charCode === 'USD';
    }).rate;
 
    console.log(rate); //it will print rate for USD for date '12/24/2014': 10950
});

Readme

Keywords

none

Package Sidebar

Install

npm i nbrb-currency

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • havenchyk