const fs = require('fs');
let rs = fs.createReadStream('./data1.txt') // 流入读取
rs.on('data',chunk=>{
console.log(chunk)
console.log(chunk.length) // 一次读入64K
})
// 读取完毕后,执行 end 回调 (可选事件)
rs.on('end', () =>{ // 流入关闭
console.log('读取完毕')
})
const fs = require('fs');
let rs = fs.createReadStream('./data1.txt') // 流入读取
rs.on('data',chunk=>{
console.log(chunk)
console.log(chunk.length) // 一次读入64K
})
// 读取完毕后,执行 end 回调 (可选事件)
rs.on('end', () =>{ // 流入关闭
console.log('读取完毕')
})
暂无评论
2023-11-02
2023-11-02
2023-11-02
2023-11-02
2023-11-02
2023-11-02
2023-11-02
2023-11-02
2023-11-02
2023-11-02
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23
2023-12-23