Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
readable-wrap
Advanced tools
upgrade streams1 to streams2 streams as a standalone module
This module provides a wrap function based on Readable().wrap()
from node core
but as a standalone module.
Use this module if you don't want to wait for a patch in node core to land that fixes falsey objectMode values in wrapped readable streams.
var split = require('split');
var wrap = require('readable-wrap');
var through = require('through2');
process.stdin.pipe(wrap.obj(split())).pipe(through.obj(write));
function write (buf, enc, next) {
console.log(buf.length + ': ' + buf);
next();
}
output:
$ echo -e 'one\ntwo\n\nthree' | node example/split.js
3: one
3: two
0:
5: three
0:
In object mode you get the empty lines, which is handy if you need to perform a special action on empty lines such as to partition an HTTP request header from a body in a streaming fashion.
In non-object mode the empty lines get ignored because that is how node core streams work.
var wrap = require('readable-wrap')
Return a new streams2 stream
based on the streams1 stream oldStream
.
The opts
will be passed to the underlying readable stream instance.
Return a new streams2 stream
based on the streams1 stream oldStream
with
opts.objectMode
set to true
.
With npm do:
npm install readable-wrap
MIT
FAQs
upgrade streams1 to streams2 streams as a standalone module
The npm package readable-wrap receives a total of 26,568 weekly downloads. As such, readable-wrap popularity was classified as popular.
We found that readable-wrap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.