Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

duplexify

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duplexify - npm Package Compare versions

Comparing version 3.4.3 to 3.4.4

15

index.js

@@ -27,2 +27,15 @@ var stream = require('readable-stream')

var getStateLength = function(state) {
if (state.buffer.length) {
// Since node 6.3.0 state.buffer is a BufferList not an array
if (state.buffer.head) {
return state.buffer.head.data.length
}
return state.buffer[0].length
}
return state.length
}
var toStreams2 = function(rs) {

@@ -162,3 +175,3 @@ return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs)

while ((data = this._readable2.read(state.buffer.length ? state.buffer[0].length : state.length)) !== null) {
while ((data = this._readable2.read(getStateLength(state))) !== null) {
this._drained = this.push(data)

@@ -165,0 +178,0 @@ }

2

package.json
{
"name": "duplexify",
"version": "3.4.3",
"version": "3.4.4",
"description": "Turn a writeable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input",

@@ -5,0 +5,0 @@ "main": "index.js",

var tape = require('tape')
var through = require('through2')
var concat = require('concat-stream')
var net = require('net')
var duplexify = require('./')

@@ -269,2 +270,24 @@

})
})
})
tape('works with node native streams (net)', function(t) {
t.plan(1)
var server = net.createServer(function(socket) {
var dup = duplexify(socket, socket)
dup.once('data', function(chunk) {
t.same(chunk, Buffer('hello world'))
server.close()
socket.end()
t.end()
})
})
server.listen(0, function () {
var socket = net.connect(server.address().port)
var dup = duplexify(socket, socket)
dup.write(Buffer('hello world'))
})
})

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc