tail -f logfile.txt outputs the last 10 lines of logfile.txt, and then continues to output appended data as the file grows.
tail -f logfile.txt
What\'s the recommended way
Substack has a file slice module that behaves exactly like tail -f, slice-file can stream updates after the initial slice of 10 lines.
tail -f
var sf = require('slice-file'); var xs = sf('/var/log/mylogfile.txt'); xs.follow(-10).pipe(process.stdout);
Source: https://github.com/substack/slice-file#follow