I was using this problem, but then got problems as soon as I started to use a newer version of Node. The following code can replace this module:
module.exports = {
encode(string){
return new Buffer(string).toString('base64');
},
decode(encodedString){
return new Buffer(encodedString, 'base64').toString('ascii');
}
};
Does this work for all versions of Node? If so I think this module should just use the above code.
I was using this problem, but then got problems as soon as I started to use a newer version of Node. The following code can replace this module:
Does this work for all versions of Node? If so I think this module should just use the above code.