Promise version of concat-stream.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
README.md
UNLICENSE
package.json
test.js

README.md

stream-concat-promise npm version

Promise version of concat-stream.

Description

A bit like concat-stream-promise but actually uses concat-stream internally, so you can use its regular options and behavior.

Usage

Standard

/**
 * @param {Stream} stream The stream to concatenate.
 * @param {Object} [opts] concat-stream options.
 * @return {Promise}
 */
import concat from 'stream-concat-promise'

concat(process.stdin)
  .then(console.log)

Mixed stream/promise

This is a version to mimic concat-stream-promise API. It can't pass the stream errors to the promise, so you're still required to do stream error handling.

/**
 * @param {Object} [opts] concat-stream options.
 * @return {Stromise} Both a stream and a promise.
 */
import concat from 'stream-concat-promise/mixed'

process.stdin
  .pipe(concat())
  .then(console.log)