Stdio functions for pull streams.
var { stdin, stdout, stderr } = require('pull-stdio')
pull(
// Source stream for stdin
stdin(),
// Sink stream for stdout
stdout()
)
// Also a sink stream for stderr
pull(
pull.values(['Error', 'blahlbah']),
stderr()
)
This module is a simple wrapper around stream-to-pull-stream
on the native process.stdio
streams. If you have any further ideas for this module feel free to open an issue.
$ npm install --save pull-stdio
The object which contains the stdio functions stdin
, stdout
, and stderr
for pull streams.
var stdio = require('pull-stdio')
pull(
stdio.stdin()
// ...
)
A source pull stream for Node's process.stdin
.
encoding
(String
|false
): Set theprocess.stdin
encoding, or tofalse
. Defaults to'utf8'
.
pull(
stdin({ encoding: false }),
// ...
)
A sink stream for Node's process.stdout
.
pull(
// Source data somewhere
// Output to stdout:
stdout()
)
A sink stream for Node's process.stderr
.
pull(
// Source data somewhere
// Output to stderr:
stderr()
)
MIT © Jamen Marz