1.0.1 • Published 8 years ago

catch-stdio v1.0.1

Weekly downloads
7
License
-
Repository
-
Last release
8 years ago

catch-stdio

Catch stdio

Installation

npm install catch-stdio

Example

var Stream = require('stream').PassThrough
var stdio = require('catch-stdio')
var stream = Stream()

var stderr = stdio.stderr(stream)

// stream to another source
stream.on('data', function (buf) {
  console.log(buf.toString())
})

console.error('a')
console.error('b')
console.error('c')

// restore stderr and get the buffered response
// in this case "a\nb\nc\n"
var buffered = stderr()

License

MIT

1.0.1

8 years ago

1.0.0

8 years ago