
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Access resources (e.g. exchange rates) provided by the National Bank of Romania.
# Using npm
npm install --save bnr
# Using yarn
yarn add bnr
const bnr = require("bnr");
// Get the currency rates
bnr.getRates((err, rates) => {
console.log(err || rates);
// { RON: { multiplier: 1, amount: 1, name: 'RON' },
// AED: { amount: 1.1375, name: 'AED', multiplier: 1 },
// AUD: { amount: 3.1078, name: 'AUD', multiplier: 1 },
// BGN: { amount: 2.3013, name: 'BGN', multiplier: 1 },
// BRL: { amount: 1.2211, name: 'BRL', multiplier: 1 },
// CAD: { amount: 3.1515, name: 'CAD', multiplier: 1 },
// CHF: { amount: 4.1492, name: 'CHF', multiplier: 1 },
// CNY: { amount: 0.6073, name: 'CNY', multiplier: 1 },
// CZK: { amount: 0.1664, name: 'CZK', multiplier: 1 },
// DKK: { amount: 0.605, name: 'DKK', multiplier: 1 },
// EGP: { amount: 0.2324, name: 'EGP', multiplier: 1 },
// EUR: { amount: 4.5008, name: 'EUR', multiplier: 1 },
// GBP: { amount: 5.3302, name: 'GBP', multiplier: 1 },
// HRK: { amount: 0.597, name: 'HRK', multiplier: 1 },
// HUF: { amount: 1.4308, name: 'HUF', multiplier: 100 },
// INR: { amount: 0.0615, name: 'INR', multiplier: 1 },
// JPY: { amount: 3.6641, name: 'JPY', multiplier: 100 },
// KRW: { amount: 0.357, name: 'KRW', multiplier: 100 },
// MDL: { amount: 0.208, name: 'MDL', multiplier: 1 },
// MXN: { amount: 0.2036, name: 'MXN', multiplier: 1 },
// NOK: { amount: 0.5001, name: 'NOK', multiplier: 1 },
// NZD: { amount: 2.9782, name: 'NZD', multiplier: 1 },
// PLN: { amount: 0.9992, name: 'PLN', multiplier: 1 },
// RSD: { amount: 0.0365, name: 'RSD', multiplier: 1 },
// RUB: { amount: 0.0655, name: 'RUB', multiplier: 1 },
// SEK: { amount: 0.4581, name: 'SEK', multiplier: 1 },
// TRY: { amount: 1.1887, name: 'TRY', multiplier: 1 },
// UAH: { amount: 0.1602, name: 'UAH', multiplier: 1 },
// USD: { amount: 4.1782, name: 'USD', multiplier: 1 },
// XAU: { amount: 157.3266, name: 'XAU', multiplier: 1 },
// XDR: { amount: 5.6865, name: 'XDR', multiplier: 1 },
// ZAR: { amount: 0.3065, name: 'ZAR', multiplier: 1 } }
});
// Convert 100 EUR into USD
bnr.convert(100, "EUR", "USD", function (err, amount, output) {
if (err) { return console.error(err); }
console.log(`Result: ${amount}`);
console.log(`${output.input.amount} ${output.input.currency} is ${output.output.amount} ${output.output.currency}`);
// Result: 107.72102819395911
// 100 EUR is 107.72102819395911 USD
});
// The promise way
bnr.getRates().then(console.log)
There are few ways to get help:
getRates(cb)Get the currency exchange rates.
cb: The callback function.convert(amount, inputCurrency, outputCurrency, cb)Convert currencies.
amount: The amount of the input currency.inputCurrency: The input currency name (e.g. EUR).outputCurrency: The output currency (e.g. USD).cb: The callback function.Have an idea? Found a bug? See how to contribute.
If you are using this library in one of your projects, add it in this list. :sparkles:
bloggify-shopFAQs
Access resources (e.g. exchange rates) provided by the National Bank of Romania.
We found that bnr demonstrated a not healthy version release cadence and project activity because the last version was released 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.