I currently have a blob of type 'image/jpeg' that I need to convert to a base64 string. All my code is in a independent javascript file using Nodejs and is not connected with any html files. Every method I have looked into to turn the blob into base64 involves using the FileReader class which requires the javascript to be within html, so that is out of the question. The only other work around I found was to convert the blob into a buffer then to base64 using this line of code.
base64 = new Buffer( blob, 'binary').toString('base64');
But this only returns the error: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
I am quite stumped... any suggestions?
blobfile ? Can't you simply open the file withfs?