function writeToFileEntry(entry, text) {
entry.createWriter(
(fileWriter) => {
let data = Blob([text], { type: "text/plain" });
fileWriter.write(data);
},
(error) => {
/* do whatever to handle the error */
},
);
}FileSystemFileEntry: createWriter() method / notebook
FileSystemFileEntry: createWriter() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.