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

stream-connect

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-connect - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

30

lib/stream-connect.js

@@ -46,13 +46,21 @@ 'use strict'

connected._read = function () {}
connected.on('finish', function () {
one.end()
})
connected
.on('finish', function () {
one.end()
})
.on('pipe', function () {
one.emit('pipe')
})
/* use flowing rather than paused mode, for node 0.10 compatibility. */
two.on('data', function (chunk) {
connected.push(chunk)
})
two.on('end', function () {
connected.push(null)
})
two
.on('data', function (chunk) {
connected.push(chunk)
})
.on('end', function () {
connected.push(null)
})
.on('error', function (err) {
connected.emit('error', err)
})

@@ -62,6 +70,4 @@ one.on('error', function (err) {

})
two.on('error', function (err) {
connected.emit('error', err)
})
return connected

@@ -68,0 +74,0 @@ }

2

package.json
{
"name": "stream-connect",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "0.2.2",
"version": "0.2.3",
"description": "Create a pipeline of connected streams",

@@ -6,0 +6,0 @@ "repository": "https://github.com/75lb/stream-connect.git",

@@ -44,13 +44,19 @@ var test = require('tape')

test('pipe', function (t) {
t.plan(2)
t.plan(3)
var pass1 = PassThrough()
pass1.on('data', function (data) {
t.strictEqual(data.toString(), 'test\n')
})
var pass2 = PassThrough()
pass2.on('data', function (data) {
t.strictEqual(data.toString(), 'test\n')
})
pass1
.on('pipe', function () {
t.pass('"pipe" emitted')
})
.on('data', function (data) {
t.strictEqual(data.toString(), 'test\n', 'correct "data" 1')
})
pass2
.on('data', function (data) {
t.strictEqual(data.toString(), 'test\n', 'correct "data" 2')
})
var connected = streamConnect(pass1, pass2)

@@ -57,0 +63,0 @@ fs.createReadStream('test/fixture.txt', 'utf8').pipe(connected)

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