Skip to content

havenchyk/nbrb-currency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

This repository contains sources of package for getting of currencies of the National Bank of the Republic of Belarus.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published