1.node.js文件系统
var =要求(FS )
2。异步和同步
功能:读取文件内容有异步fs.readfile()和同步fs.readfilesync()。
VaR FS =需要('fs)
fs.readfile('a.txt ','utf-8功能(呃,数据){
如果(错误)
{
Console.error(ERR)
其他{ }
console.log(不aynsc = = = >+数据)
}
})
console.log('app开始)
VaR RLT = fs.readfilesync('a.txt)
console.log('rlt = = = = > + RLT)
谢谢你的阅读。我希望你能帮助你,谢谢你对这个站的支持。