📜  如何在javascript代码示例中从本地文件中读取文本

📅  最后修改于: 2022-03-11 15:03:09.558000             🧑  作者: Mango

代码示例1
fetch("file.txt")
    .then((response) => {
          return response.text();
    })
    .then((text) => {
          console.log(text);
    });