nodejs btoa
snippet in javascript

nodejs btoa

user8775

Buffer.from('Hello world!', 'binary').toString('base64')

atob nodejs

user2475

(function () {
  "use strict";

  var atob = require('atob');
  var b64 = "SGVsbG8sIFdvcmxkIQ==";
  var bin = atob(b64);

  console.log(bin); // "Hello, World!"
}());

rror: btoa is not defined

user9110

console.log(Buffer.from('Hello World!').toString('base64'));