Skip to content

Instantly share code, notes, and snippets.

@lancevo
Forked from jmshal/atob.js
Created December 14, 2018 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lancevo/d13510337da44bd75ca9074b1b000d90 to your computer and use it in GitHub Desktop.
Save lancevo/d13510337da44bd75ca9074b1b000d90 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