![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
labeled-stream-splicer
Advanced tools
Readme
stream splicer with labels
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.
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.
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.
Create a pipeline
with opts.objectMode
set to true for convenience.
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.
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.
Pop a stream from the end of the pipeline.
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.
Shift a stream from the begining of the pipeline.
Return the stream at index index
.
index
can be an integer or a string label.
With npm do:
npm install labeled-stream-splicer
MIT
FAQs
stream splicer with labels
The npm package labeled-stream-splicer receives a total of 747,104 weekly downloads. As such, labeled-stream-splicer popularity was classified as popular.
We found that labeled-stream-splicer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 40 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.