catch-stdio

1.0.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i catch-stdio

    Weekly Downloads

    0

    Version

    1.0.1

    License

    none

    Last publish

    Collaborators

    • mattmueller