Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

keep-reading

soldair22ISC1.1.0

keep reading a file. like tail but with no concept of lines and no watching.

tail, file, stream

readme

keep-reading

keep reading a file. like tail but with no concept of lines and no watching.

var tail = require('keep-reading')

var stream = tail('/var/log/some.log')

stream.on('data',function(buf){
  console.log(buf,'is the data read from the file.')
  console.log(buf.start,'is the byte offset of the bufers starting position in the file')
})

stream.on('waiting',function(duration){
  console.log('will wait for ',duration,'ms before checking to see if the file has more data. exponential backoff')
})

stream.on('open',function(fd){
  console.log(fd,'is the file descriptor being read')
})

stream.on('close',function(){
  console.log('the file descriptor is closed. always fires after end.')
})