1、基于Express框架(www.expressjs.com.cn)可以快速构建web应用
2、基于Electron框架(electronjs.org)可以快速构建跨平台的桌面应用
3、基于restify框架(restify.com)可以快速构建API接口项目
FS文件系统模块
const fs=require('fs')//导入fs模块
fs.readFile(path[,option],callback)//读取制定文件中的内容
//例,文件读取,此读取为异步读取,同步为readFileSync
fs.readFile('123.txt','utf8',function (err, dataStr) {
console.log(err)
console.log(dataStr)
})
//当读取成功时err值为null
//此读取为异步写入,同步为writeFileSync
fs.writeFile('123.txt','hello node',function (err) {
console.log(err)
})
- 本文链接:https://archer-lan.github.io/2022/03/04/Node.js%20%E5%AD%A6%E4%B9%A0-01/
- 版权声明:本博客所有文章除特别声明外,均默认采用 许可协议。