What posture does javascript have to read / write local files?

list all the javascript ways you know about reading / writing local files, traditional, weird or creative.
first give an example to show respect:

var fs=require("fs");
 
fs.readFile("readtxt/demo.txt","utf-8",function(err,data){
    if(err){
        console.error(err);
    }
    else{
        console.log(data);
    }
});
Mar.23,2021

js cannot read or write local files in the browser.


streaming

const fs = require('fs');
const read = fs.createReadStream('./package-lock.json');
const data = [];
read.on('data', function(chunk) {
  data.push(chunk.toString());
});
read.on('end', function() {
  console.log(data);
});
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38453-2c118.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38453-2c118.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?