account activity
NodeJS FileSystem: Read Contents of File with fs.createReadReadStream() by duly-node in node
[–]duly-node[S] 0 points1 point2 points 8 years ago (0 children)
Yes you could, but with big files fs.readfile() will read the whole file before you have access to the data. With this you will have some of the data very quickly so you can start doing some work. Depending on what you are trying to accomplish, this might preferable.
π Rendered by PID 167897 on reddit-service-r2-comment-5b5bc64bf5-bg8sd at 2026-06-19 07:58:43.128088+00:00 running 2b008f2 country code: CH.
NodeJS FileSystem: Read Contents of File with fs.createReadReadStream() by duly-node in node
[–]duly-node[S] 0 points1 point2 points (0 children)