node-b64
Basic implementations of btoa and atob for Node v6+
Why?
Becaue I got tired of writing
Buffer;
Usage
Using the entire module:
"use strict"; const b64 = ; const str = 'this is some stuff'; /** * Encode a string */b64; // Prints -> 'dGhpcyBpcyBzb21lIHN0dWZm' /** * Decode a string */ b64; // Prints -> 'this is some stuff' /** * Works with buffers too */ === // true
Or just use one of the two functions:
const btoa = ;const atob = ; const str2 = 'this is other stuff'; ; ;