Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

keep-reading

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keep-reading

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

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

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.')
})

Keywords

tail

FAQs

Package last updated on 15 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts