Skip to content

Instantly share code, notes, and snippets.

@Ankarrr
Last active October 23, 2019 08:38
Show Gist options
  • Save Ankarrr/a41b79b5965fd4f6eec69c4e8ccb0649 to your computer and use it in GitHub Desktop.
Save Ankarrr/a41b79b5965fd4f6eec69c4e8ccb0649 to your computer and use it in GitHub Desktop.
if (!global.btoa) {
global.btoa = function (str) {
return new Buffer(str, 'binary').toString('base64');
};
}
if (!global.atob) {
global.atob = function (b64Encoded) {
return new Buffer(b64Encoded, 'base64').toString('binary');
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment