fs-tail node.js的基于流的tail -f功能。 var FsTail = require ( "fs-tail" ) ; // Available options - defaults are shown. var options = { start : 0 //Start on byte 0 of file. EOFAfter : 500 //emit EOF after 500ms of no data. } ; var tail = FsTail ( "./someFile.txt" , options ) ; tail . on ( "EOF" , function ( ) { console . log ( "Reached end of file" ) ; } ) ; tail . pipe ( anotherStream ) ;