'use strict';
let data = 'stackabuse.com';
let buff = new Buffer(data);
let base64data = buff.toString('base64');
console.log('"' + data + '" converted to Base64 is "' + base64data + '"');
const atob = str => Buffer.from(str, 'base64').toString('binary'); atob('Zm9vYmFy'); // 'foobar'