Skip to content

heiwais25/merge-stream-lines

Repository files navigation

merge-stream-lines

Merge each line in the multiple streams like below

stream1: 1 / 2 / 3 / 4
stream2: 5 / 6 / 7 / 8
======================
merged : 1 / 5 / 2 / 6 / 3 / 7 / 4 / 8 

Usage

import { createMergeStream } from "merge-stream-lines"

// In seqeuntial flat-array
// ex) 1 / 5 / 2 / 6 ...
const sequentialFlatStream = createMergeStream()
sequentialFlatStream(...stream).pipe(process.stdout)

// In seqeuntial flat-array
// ex) [1, 5] / [2, 6] ...
const sequentialObjectArray = createMergeStream()
sequentialObjectArray(...stream).pipe(process.stdout)

About

A node project for merging lines from the streams

Resources

License

Stars

Watchers

Forks

Packages

No packages published