shfshanyue / Daily-Question

互联网大厂内推及大厂面经整理,并且每天一道面试题推送。每天五分钟,半年大厂中
https://q.shanyue.tech
4.92k stars 508 forks source link

【Q680】在 Node 中如何读取大文件的内容 #699

Open shfshanyue opened 3 years ago

shfshanyue commented 3 years ago
import { createReadStream } from 'fs';

const stream = createReadStream('bigfile.json');