All Projects → browserify → Labeled Stream Splicer

browserify / Labeled Stream Splicer

Licence: mit
stream splicer with labels

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Labeled Stream Splicer

Stream Splicer
streaming pipeline with a mutable configuration
Stars: ✭ 52 (+40.54%)
Mutual labels:  stream, streams, pipeline
streamalg
Extensible stream pipelines with object algebras.
Stars: ✭ 26 (-29.73%)
Mutual labels:  pipeline, streams
tpack
Pack a Go workflow/function as a Unix-style pipeline command
Stars: ✭ 55 (+48.65%)
Mutual labels:  stream, pipeline
wasm-streams
Bridging between web streams and Rust streams using WebAssembly
Stars: ✭ 61 (+64.86%)
Mutual labels:  stream, streams
Cypher Stream
Neo4j Cypher queries as Node.js object streams
Stars: ✭ 58 (+56.76%)
Mutual labels:  stream, streams
Multistream
A stream that emits multiple other streams one after another (streams3)
Stars: ✭ 237 (+540.54%)
Mutual labels:  stream, streams
godsend
A simple and eloquent workflow for streaming messages to micro-services.
Stars: ✭ 15 (-59.46%)
Mutual labels:  stream, streams
go-streams
Stream Collections for Go. Inspired in Java 8 Streams and .NET Linq
Stars: ✭ 127 (+243.24%)
Mutual labels:  stream, streams
web-streams-polyfill
Web Streams, based on the WHATWG spec reference implementation
Stars: ✭ 198 (+435.14%)
Mutual labels:  stream, streams
Go Streams
A lightweight stream processing library for Go
Stars: ✭ 615 (+1562.16%)
Mutual labels:  streams, pipeline
Sql Streams
Painless low level jdbc abstraction using the java 8 stream api.
Stars: ✭ 17 (-54.05%)
Mutual labels:  stream, streams
Remote Web Streams
Web streams that work across web workers and iframes.
Stars: ✭ 26 (-29.73%)
Mutual labels:  stream, streams
Rivers
Data Stream Processing API for GO
Stars: ✭ 39 (+5.41%)
Mutual labels:  stream, pipeline
streamplify
Java 8 combinatorics-related streams and other utilities
Stars: ✭ 40 (+8.11%)
Mutual labels:  stream, streams
bash-streams-handbook
💻 Learn Bash streams, pipelines and redirection, from beginner to advanced.
Stars: ✭ 153 (+313.51%)
Mutual labels:  pipeline, streams
Chunk Store Stream
Convert an abstract-chunk-store compliant store into a readable or writable stream
Stars: ✭ 24 (-35.14%)
Mutual labels:  stream, streams
Gollum
An n:m message multiplexer written in Go
Stars: ✭ 883 (+2286.49%)
Mutual labels:  stream, pipeline
Xtream Iptv Player Reactnative
Stars: ✭ 30 (-18.92%)
Mutual labels:  stream
Cimonitor
Displays CI statuses on a dashboard and triggers fun modules representing the status!
Stars: ✭ 34 (-8.11%)
Mutual labels:  pipeline
Datakit
Connect processes into powerful data pipelines with a simple git-like filesystem interface
Stars: ✭ 951 (+2470.27%)
Mutual labels:  pipeline

labeled-stream-splicer

stream splicer with labels

build status

example

Here's an example that exposes a label for deps and pack:

var splicer = require('labeled-stream-splicer');
var through = require('through2');
var deps = require('module-deps');
var pack = require('browser-pack');
var lstream = require('lstream');

var pipeline = splicer.obj([
    'deps', [ deps() ],
    'pack', [ pack({ raw: true }) ]
]);

pipeline.get('deps').unshift(lstream());

pipeline.get('deps').push(through.obj(function (row, enc, next) {
    row.source = row.source.toUpperCase();
    this.push(row);
    next();
}));

process.stdin.pipe(pipeline).pipe(process.stdout);

Here the deps sub-pipeline is augmented with a post-transformation that uppercases its source input.

methods

var splicer = require('labeled-stream-splicer')

The API is the same as stream-splicer, except that pipeline.get(), pipeline.splice(), and pipeline.indexOf() can accept string labels in addition to numeric indexes.

var pipeline = splicer(streams, opts)

Create a pipeline duplex stream given an array of streams. Each stream will be piped to the next. Writes to pipeline get written to the first stream and data for reads from pipeline come from the last stream.

To signify a label, a stream may have a .label property or a string may be placed in the streams array.

For example, for streams [ a, 'foo', b, c, 'bar', d ], this pipeline is constructed internally:

a.pipe(b).pipe(c).pipe(d)

with a label 'foo' that points to b and a label 'bar' that points to d. If a or c has a .label property, that label would be used for addressing.

Input will get written into a. Output will be read from d.

If any of the elements in streams are arrays, they will be converted into nested labeled pipelines. This is useful if you want to expose a hookable pipeline with grouped insertion points.

var pipeline = splicer.obj(streams, opts)

Create a pipeline with opts.objectMode set to true for convenience.

var removed = pipeline.splice(index, howMany, stream, ...)

Splice the pipeline starting at index, removing howMany streams and replacing them with each additional stream argument provided.

The streams that were removed from the splice and returned.

index can be an integer index or a label.

pipeline.push(stream, ...)

Push one or more streams to the end of the pipeline.

The stream arguments may have a label property that will be used for string lookups.

var stream = pipeline.pop()

Pop a stream from the end of the pipeline.

pipeline.unshift(stream, ...)

Unshift one or more streams to the begining of the pipeline.

The stream arguments may have a label property that will be used for string lookups.

var stream = pipeline.shift()

Shift a stream from the begining of the pipeline.

var stream = pipeline.get(index)

Return the stream at index index.

index can be an integer or a string label.

install

With npm do:

npm install labeled-stream-splicer

license

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].