sandwich-stream
- Version 2.0.2
- Published
- 24.3 kB
- No dependencies
- Apache-2.0 license
Install
npm i sandwich-stream
yarn add sandwich-stream
pnpm add sandwich-stream
Overview
A readable stream that concatenates multiple streams with optional head, tail & join buffers
Index
Classes
Interfaces
Classes
class SandwichStream
class SandwichStream extends Readable {}
Handles Readable streams requests as concatenation through data handling as well adding tags it each begin, end and between of the streams
constructor
constructor({ head, tail, separator, ...remaining }: SandwichOptions);
Initiates the SandwichStream, you can consider it also passing ReadableOptions to it
Parameter head
Pushes this content before all other content
Parameter tail
Pushes this content after all other data has been pushed
Parameter separator
Pushes this content between each stream
Parameter remaining
The other kind of options to be passed to Readable
Example 1
const ss = new SandwichStream({ head: 'This at the top\n', tail: '\nThis at the bottom', separator: '\n --- \n' });
method add
add: (newStream: Readable) => this;
Add a new Readable stream in the queue
Parameter newStream
The Readable stream
Returns
This instance of Sandwich Stream
Throws
An Error in case that this request was not accepted
Example 1
sandwichStream.add(streamOne); sandwichStream.add(streamTwo); sandwichStream.add(streamThree);
Interfaces
interface SandwichOptions
interface SandwichOptions extends ReadableOptions {}
Sandwich Options that will configure parsed data
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (14)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/sandwich-stream
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/sandwich-stream)
- HTML<a href="https://www.jsdocs.io/package/sandwich-stream"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 554 ms. - Missing or incorrect documentation? Open an issue for this package.