Skip to content

Instantly share code, notes, and snippets.

@zavarat
Forked from jmshal/atob.js
Created May 22, 2020 04:09
Show Gist options
  • Save zavarat/29dcaa7c242bddf386d8992356d7f94e to your computer and use it in GitHub Desktop.
Save zavarat/29dcaa7c242bddf386d8992356d7f94e to your computer and use it in GitHub Desktop.
Node.js ponyfill for atob and btoa encoding functions
module.exports = function atob(a) {
return new Buffer(a, 'base64').toString('binary');
};
module.exports = function btoa(b) {
return new Buffer(b).toString('base64');
};
module.exports = {
atob: require('./atob'),
btoa: require('./btoa'),
};
{
"name": "atob-btoa.js",
"version": "1.0.0",
"description": "Node.js ponyfill for atob and btoa encoding functions"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment