NodeJS compartible Buffer implemenattion. See original Buffer doumnetation
One additional method is adedd for converting buffer content to any codepage Buffer.prototype.cpSlice
:
let arr = fs.readFileSync(path.join(__dirname, 'win1251Encoded.XML'), {encoding: 'binary'})
let buffer = Buffer.from(arr)
let strData = buffer.cpSlice(0, buffer.length, 1251)