0.0.3 • Published 4 years ago

last-bytes v0.0.3

Weekly downloads
53
License
MIT
Repository
github
Last release
4 years ago

SYNOPSIS

Keep the last count bytes around from a stream.

EXAMPLE

var lastBytes = require('last-bytes')
var spawn = require('child_proc').spawn

var ps = child_proc.spawn(...)
// keep 1024 bytes around from the stream, at given time only that much
var stderrBuf = lastBytes(1024, ps.stderr)

// at any given time we can inspect the last 1K of stderr:
setTimeout(() => {
  console.log(stderrBuf.toString()))
}, 1000)

Note

Interface is still in flux thus < 1.0.0. I'm not happy about passing the source in as an argument. I feel like we should just return a stream-like that you can pipe into but also call something like .read or something.

0.0.3

4 years ago

0.0.2

8 years ago

0.0.1

8 years ago