Gathering detailed insights and metrics for labeled-stream-splicer
Gathering detailed insights and metrics for labeled-stream-splicer
Gathering detailed insights and metrics for labeled-stream-splicer
Gathering detailed insights and metrics for labeled-stream-splicer
npm install labeled-stream-splicer
96
Supply Chain
100
Quality
82.1
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
43 Stars
24 Commits
7 Forks
2 Watching
1 Branches
28 Contributors
Updated on 18 Oct 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-4.6%
211,718
Compared to previous day
Last week
7.9%
1,356,289
Compared to previous week
Last month
25.9%
4,936,503
Compared to previous month
Last year
-20.9%
49,647,503
Compared to previous year
2
5
stream splicer with labels
Here's an example that exposes a label for deps
and pack
:
1var splicer = require('labeled-stream-splicer'); 2var through = require('through2'); 3var deps = require('module-deps'); 4var pack = require('browser-pack'); 5var lstream = require('lstream'); 6 7var pipeline = splicer.obj([ 8 'deps', [ deps() ], 9 'pack', [ pack({ raw: true }) ] 10]); 11 12pipeline.get('deps').unshift(lstream()); 13 14pipeline.get('deps').push(through.obj(function (row, enc, next) { 15 row.source = row.source.toUpperCase(); 16 this.push(row); 17 next(); 18})); 19 20process.stdin.pipe(pipeline).pipe(process.stdout);
Here the deps
sub-pipeline is augmented with a post-transformation that
uppercases its source input.
1var 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
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 1/21 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More@types/labeled-stream-splicer
TypeScript definitions for labeled-stream-splicer
stream-splicer
streaming pipeline with a mutable configuration
require-times
see how long files take to require from the CLI
readable-stream
Node.js Streams, a user-land copy of the stream library from Node.js