Skip to content

Instantly share code, notes, and snippets.

@kriscooke
Forked from jmshal/atob.js
Created June 18, 2020 04:46
Show Gist options
  • Save kriscooke/ee44e99acce9967437e62e9a1c26b2a2 to your computer and use it in GitHub Desktop.
Save kriscooke/ee44e99acce9967437e62e9a1c26b2a2 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