JSPM

pull-stdio

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q47090F
  • License MIT

Stdio functions for pull streams.

Package Exports

  • pull-stdio

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pull-stdio) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pull-stdio NPM version Build Status

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.

Installation

$ npm install --save pull-stdio

Usage

stdio.{method}

The object which contains the stdio functions stdin, stdout, and stderr for pull streams.

Example

var stdio = require('pull-stdio')

pull(
  stdio.stdin()
  // ...
)

stdin([options])

A source pull stream for Node's process.stdin.

Options

  • encoding (String|false): Set the process.stdin encoding, or to false. Defaults to 'utf8'.

Example

pull(
  stdin({ encoding: false }),
  // ...
)

stdout()

A sink stream for Node's process.stdout.

Example

pull(
  // Source data somewhere
  // Output to stdout:
  stdout()
)

stderr()

A sink stream for Node's process.stderr.

Example

pull(
  // Source data somewhere
  // Output to stderr:
  stderr()
)

License

MIT © Jamen Marz