1 Star 0 Fork 0

我们回家吧/test1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
07then-fs.js 406 Bytes
一键复制 编辑 原始数据 按行查看 历史
我们回家吧 提交于 2021-10-24 18:32 . first commit
//es6引入gi
import thenFs from 'then-fs'
//有顺序的读取文件,用promise 可以避免回调地狱
let p1=thenFs.readFile('./file/1.txt','utf8').then((data)=>{
console.log('文件1',data);
return thenFs.readFile('./file/2.txt','utf8')
}).then((data)=>{
console.log('文件2',data);
return thenFs.readFile('./file/3.txt','utf8')
}).then((data)=>{
console.log('文件3',data);
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/I520play/test1.git
git@gitee.com:I520play/test1.git
I520play
test1
test1
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385