Skip to content

valeriangalliat/stream-concat-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Promise version of concat-stream.

Resources

License

Stars

Watchers

Forks