Node.js: Count the number of lines in a file

前端 未结 10 645
一向
一向 2020-12-02 23:02

I have large text files, which range between 30MB and 10GB. How can I count the number of lines in a file using Node.js?

I hav

10条回答
  •  离开以前
    2020-12-02 23:23

    There is an npm module called count-lines-in-file. I've been using it for smallish (<1000 lines) files and it's worked great so far.

提交回复
热议问题