I have an audio blob, I then run
var reader = new FileReader(); reader.readAsDataURL(blob); reader.onloadend = () => { var base64data = reader.result;
You have binary data encoded in base64 string here. First of all you need trim data url meta info. Then you can create binary buffer from base64 string and store it to file.
fs.writeFileSync('file.ogg', Buffer.from(base64data.replace('data:audio/ogg; codecs=opus;base64,', ''), 'base64'));