-
-
Save jsmithdev/7bcee460c94dd7281fb5d41e1a1052e2 to your computer and use it in GitHub Desktop.
Node.js ponyfill for atob and btoa encoding functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const atob = a => Buffer.from(a, 'base64').toString('binary') | |
module.exports = { atob } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const btoa = b => Buffer.from(b).toString('base64') | |
module.exports = { bota } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { atob } = require('./atob') | |
const { btoa } = require('./btoa') | |
module.exports = { atob, btoa } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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