const Buffer = require("buffer").Buffer; let encodedAuth = new Buffer("your text").toString("base64");