Буфер от Base64
const b64string = /* whatever */;
const buf = Buffer.from(b64string, 'base64');
Ugliest Unicorn
const b64string = /* whatever */;
const buf = Buffer.from(b64string, 'base64');
'use strict';
let data = 'stackabuse.com';
let buff = new Buffer(data);
let base64data = buff.toString('base64');
console.log('"' + data + '" converted to Base64 is "' + base64data + '"');