A simple Node.js library for the NBRB API.
npm install nbrb
import { NBRBClient } from "nbrb";
const client = new NBRBClient();
.getCurrencies()
const currencies = await client.getCurrencies();
.getCurrency()
const Cur_ID = 431;
const currency = await client.getCurrency({ Cur_ID });
.getRates()
const ondate = new Date("2020-8-1");
const rates = await client.getRates({ ondate });
.getRate()
const ondate = new Date("2020-8-1");
// by `Cur_ID`
const Cur_ID = 431;
const rate = await client.getRate({ ondate, Cur_ID });
// by `Cur_Code`
const Cur_Code = "840";
const rate = await client.getRate({ ondate, Cur_Code });
// by `Cur_Abbreviation`
const Cur_Abbreviation = "USD";
const rate = await client.getRate({ ondate, Cur_Abbreviation });
.getDynamics()
const startdate = new Date("2021-8-1");
const enddate = new Date();
const Cur_ID = 431;
const rates = await client.getDynamics({ startdate, enddate, Cur_ID });
npm run test:ci