Building Node streams that take in line separated text and converts to objects. Streams provides size of data (bytes), time elapsed (milliseconds), total lines, rate of input stream, and growth rate of the file.
npm install before running script.
- Run
tail -f -n +1 sample.txt | node index.js
to begin streams. - While Node is running, edit the tail end of the sample.txt file.
- Terminal will stream live the new input while it's being outputed into a outout.txt file.
- Information provided when new data is received is rate of input stream, total lines, and growth rate.
- Run
npm test
to use the Chai.js file. This makes sure that the streams are readable,writable or both.