'How to split a read stream into multiple read streams by line

Hello I am a beginner in nodejs and I am trying to process large text files. How do you split read streams to multiple read streams(by line)?

logic:

  1. read aws s3 file using a read stream
  2. split read stream every 10000 lines

output: multiple read streams that have a maximum of 10,000 lines



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source