I found some simple way for me, the same api as node.
Set yarn add buffer
Usage: console.log(Buffer.from("Hello World").toString('base64')); console.log(Buffer.from("SGVsbG8gV29ybGQ=", 'base64').toString('ascii')); console.log(Buffer.from("Hello World").toString('base64')); console.log(Buffer.from("SGVsbG8gV29ybGQ=", 'base64').toString('ascii'));
source share