To convert a string to a blob in JavaScript we are going to pass the string to a Blob constructor and return the string.
const str2blob = txt => new Blob([txt]);
console.log(str2blob("Poopcode"))
//Blob {size: 8, type: ""}
//size: 8
//type: ""
//__proto__: Blob