Skip to content

Instantly share code, notes, and snippets.

@jsmithdev
Forked from jmshal/atob.js
Last active June 23, 2020 19:39
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 jsmithdev/7bcee460c94dd7281fb5d41e1a1052e2 to your computer and use it in GitHub Desktop.
Save jsmithdev/7bcee460c94dd7281fb5d41e1a1052e2 to your computer and use it in GitHub Desktop.
Node.js ponyfill for atob and btoa encoding functions
const atob = a => Buffer.from(a, 'base64').toString('binary')
module.exports = { atob }
const btoa = b => Buffer.from(b).toString('base64')
module.exports = { bota }
const { atob } = require('./atob')
const { btoa } = require('./btoa')
module.exports = { atob, 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