I'm using the following code to return my result but I always get undefined however I get the data I want in my console log. I believe this has something to do with promises, but I'm not sure how to deal with it.
var blobUtil = require('blob-util');
var mystring = "Hello World!";
var myblob = new Blob([mystring], {
type: 'text/plain'
});
this.BlobData(myblob);
function readBlob(blob) {
blobUtil.blobToBinaryString(blob)
.then(function (result) {
return result;
});
};
function BlobData(blob) {
console.log(readBlob(blob));
}