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.
<img src=https://secure.travis-ci.org/dominictarr/duplex.png?branch=master>
Simple base class for duplex streams, that automatically handles pausing and buffering.
var duplex = require('duplex')
var d = duplex()
.on('_data', function (data) {
d.sendData(data)
})
.on('_end', function () {
d.sendEnd()
})
Emitted when write(data)
is called.
Emitted when end()
is called
Add data
to the output buffer.
'data'
will be emitted if the stream is not paused.
Cap the output buffer. no more data events may be added.
'end'
will be emitted after the buffer drains,
or immediately, if the stream is unpaused.
Pause the readable side of the stream.
This will prevent it from emitting 'data' or or 'end'
until resume is called.
Unpause the readable side of the stream.
This will allow it to emit 'data'
and 'end'
events.
If there there is any data in the output buffer,
It will start draining immediately.
Pause the writable side of the stream. this will cause write() to return false, so any streams piping into this stream will pause after thier next write.
Unpause the writable side of the stream. This will cause Stream#pipe
to call resume()
on any streams piping to this stream.
destroy()
is called automatically after both sides of the stream have ended.
write()==false
after the stream emits 'pause'
,
and write()==true
after the stream emits 'drain'
.
The user is responsible for emitting 'pause'
and 'drain'
.
resume()
will be called on nextTick
, unless pause()
was called manually.
If resume()
is manually called before the nextTick
, the stream will start emitting data
immediately.
MIT / APACHE 2
FAQs
base class for a duplex stream
The npm package duplex receives a total of 25,448 weekly downloads. As such, duplex popularity was classified as popular.
We found that duplex 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.