Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
[![npm version](https://badge.fury.io/js/curs-bnr.svg)](https://badge.fury.io/js/curs-bnr) [![CI](https://github.com/crissdev/curs-bnr/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/crissdev/curs-bnr/actions/workflows/node.js.yml
Retrieve the BNR exchange rates for a specific date or the most recent BNR exchange rates.
npm install curs-bnr
Retrieve the most recent BNR exchange rates
const { getMostRecentExchangeRates } = require("curs-bnr");
const rates = await getMostRecentExchangeRates();
console.log(rates);
// [
// { date: '2023-06-02', value: 4.9633, currency: 'EUR' },
// { date: '2023-06-02', value: 5.7790, currency: 'GBP' }
// ...
// ]
Retrieve the BNR exchange rates for a specific year
const { getExchangeRatesOfYear } = require("curs-bnr");
const rates = await getExchangeRatesOfYear(2023);
console.log(rates);
// [
// { date: '2023-01-03', value: 4.9273, currency: 'EUR' },
// { date: '2023-01-04', value: 4.9264, currency: 'EUR' },
// ...
// ]
Retrieve the BNR exchange rates for a specific date
const { getExchangeRatesForDate } = require("curs-bnr");
const rates = await getExchangeRatesForDate('2023-06-12');
console.log(rates);
// [
// { date: '2023-06-12', value: 4.9568, currency: 'EUR' },
// { date: '2023-06-12', value: 5.7893, currency: 'GBP' },
// { date: '2023-06-12', value: 3.3022, currency: 'JPY', multiplier: 100 },
// ...
// ]
By default, the API is configured to use the well-known BNR endpoints. If you want to use different endpoints, you
can configure them via environment variables. Note that BNR_FX_RATES_OF_YEAR_URL
must have the same structure as the
default value, with the {year}
placeholder.
BNR_FX_RATES_MOST_RECENT_URL="https://www.bnr.ro/nbrfxrates.xml"
BNR_FX_RATES_OF_YEAR_URL="https://bnr.ro/files/xml/years/nbrfxrates{year}.xml"
MIT © Cristian Trifan
FAQs
[![npm version](https://badge.fury.io/js/curs-bnr.svg)](https://badge.fury.io/js/curs-bnr) [![CI](https://github.com/crissdev/curs-bnr/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/crissdev/curs-bnr/actions/workflows/node.js.yml
The npm package curs-bnr receives a total of 0 weekly downloads. As such, curs-bnr popularity was classified as not popular.
We found that curs-bnr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.