『nodejs』fs 模块

fs 模块

fs 模块的作用是对文件的处理

同步

data = fs.readFileSync("./tmp/index.html","utf-8")

data = fs.writeFileSync("./tmp/index.html","utf-8")

异步

data = fs.readFile("./tmp/index.html","utf-8",()=>{})

data = fs.writeFile("./tmp/index.html","utf-8",()=>{})
posted @ 2020-07-08 18:51  一生亦木  阅读(26)  评论(0编辑  收藏  举报