
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
discrete-stream
Advanced tools
discrete-stream
ensures that the chunks you put in on one end will come out in the same size on the other side.
Node 1
var en = discrete.Encoder()
en.pipe(socket)
en.write('Hello World')
Node 2
var de = discrete.Decoder()
socket.pipe(de)
de.on('readable', function () {
var message
while((message = de.read()) !== null)
console.log(message)
})
$ npm install discrete-stream
Inherits from transform stream.
The encoder transforms an input stream to the discrete
protocol.
The decoder transforms a discrete
stream back to correctly sliced buffers.
options
(object)
prefixBytes
How many bytes the size prefix header should use. Defaults to 4
prefixEndian
If we should use big or little endians. Defaults to big endians.MIT
FAQs
discrete-stream
We found that discrete-stream 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.