Gathering detailed insights and metrics for @crabas0npm/aut-reiciendis-ipsam
Gathering detailed insights and metrics for @crabas0npm/aut-reiciendis-ipsam
Gathering detailed insights and metrics for @crabas0npm/aut-reiciendis-ipsam
Gathering detailed insights and metrics for @crabas0npm/aut-reiciendis-ipsam
npm install @crabas0npm/aut-reiciendis-ipsam
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
33
StreamQueue pipe the queued streams one by one in order to preserve their content order.
## Usage Install the npm module:
1npm install @crabas0npm/aut-reiciendis-ipsam --save
Then, in your scripts:
1var @crabas0npm/aut-reiciendis-ipsam = require('@crabas0npm/aut-reiciendis-ipsam');
2
3var queue = @crabas0npm/aut-reiciendis-ipsam(
4 Fs.createReadStream('input.txt'),
5 Fs.createReadStream('input2.txt'),
6 Fs.createReadStream('input3.txt')
7).pipe(process.stdout);
StreamQueue also accept functions returning streams, the above can be written like this, doing system calls only when piping:
1var @crabas0npm/aut-reiciendis-ipsam = require('@crabas0npm/aut-reiciendis-ipsam'); 2 3var queue = @crabas0npm/aut-reiciendis-ipsam( 4 Fs.createReadStream.bind(null, 'input.txt'), 5 Fs.createReadStream.bind(null, 'input2.txt'), 6 Fs.createReadStream.bind(null, 'input3.txt') 7).pipe(process.stdout);
Object-oriented traditionnal API offers more flexibility:
1var StreamQueue = require('@crabas0npm/aut-reiciendis-ipsam');
2
3var queue = new StreamQueue();
4queue.queue(
5 Fs.createReadStream('input.txt'),
6 Fs.createReadStream('input2.txt'),
7 Fs.createReadStream('input3.txt')
8);
9queue.done();
10
11queue.pipe(process.stdout);
You can also chain StreamQueue methods like that:
1var StreamQueue = require('@crabas0npm/aut-reiciendis-ipsam');
2
3new StreamQueue()
4 .queue(Fs.createReadStream('input.txt'))
5 .queue(Fs.createReadStream('input2.txt'))
6 .queue(Fs.createReadStream('input3.txt'))
7 .done()
8 .pipe(process.stdout);
You can queue new streams at any moment until you call the done() method. So the created stream will not fire the end event until done() call.
Note that stream queue is compatible with the Node 0.10+ streams. For older
streams, stream queue will wrap them with
Readable.wrap
before queueing. Please fix your dependencies or report issues to libraries
using 0.8 streams since this extra code will finally be removed.
Type: Boolean
Default value: false
Use if piped in streams are in object mode. In this case, the stream queue will also be in the object mode.
Type: Boolean
Default value: true
If a stream is in flowing mode, then it will be paused before queueing.
Type: Boolean
Default value: true
If a stream is in flowing mode, then it will be resumed before piping.
StreamQueue inherits of Stream.PassThrough, the options are passed to the parent constructor so you can use it's options too.
Type: Stream
Append streams given in argument to the queue and ends when the queue is empty.
Append streams given in argument to the queue.
Append streams given in argument to the queue and ends when the queue is empty.
A shortcut for StreamQueue({objectMode: true})
.
Feel free to pull your code if you agree with publishing it under the MIT license.
No vulnerabilities found.
No security vulnerabilities found.