A library to encode to and decode from base64, similar to atob btoa of native JavaScript functions.
$ npm install b64-cjs
const Base64 = require('b64-cjs');
const myObj = {name: "john", age: 30};
const myObjString = JSON.stringify(myObj);
const base64EncodedString = Base64.encode(myObjString);
console.log(base64EncodedString);
const Base64 = require('b64-cjs');
const myObj = {name: "john", age: 30};
const myObjString = JSON.stringify(myObj);
const base64EncodedString = Base64.encode(myObjString);
const decodedBase64String = Base64.decode(base64EncodedMyObj);
console.log(JSON.parse(decodedBase64String));