const {get} = require('http');
const {Iconv} = require('iconv');
const {parseString} = require('xml2js');
const {inspect} = require('util');
get('http://www.cbr.ru/scripts/XML_daily.asp', res => {
const data = [];
res
.pipe(new Iconv('cp1251', 'utf8'))
.on('data', chunk => data.push(chunk))
.on('end', () =>
parseString(
Buffer.concat(data),
(err, res) => console.log(inspect(res, {depth: null}))
)
);
});