编辑代码

// var b = new Buffer('JavaScript');
// var s = b.toString('base64');
// SmF2YVNjcmlwdA==


var b = new Buffer('SmF2YVNjcmlwdA==', 'base64')
var s = b.toString();
console.log(s);