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

stream-to-pull-stream

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-to-pull-stream - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

27

index.js

@@ -19,5 +19,7 @@ var pull = require('pull-core')

function write(read, stream, cb) {
var ended, closed = false
function done (end) {
cb && cb(end === true ? null : end)
var ended, closed = false, did
function done () {
if(did) return
did = true
cb && cb(ended === true ? null : ended)
}

@@ -46,2 +48,3 @@ function onClose () {

ended = ended || end
end && console.log('end', end)
if(end === true)

@@ -68,3 +71,3 @@ return stream._isStdio ? done() : stream.end()

handler(val)
}
}
events.forEach(function (e) {

@@ -152,7 +155,3 @@ emitter.on(e, listener)

function read (stream) {
if('function' === typeof stream.read)
return read2(stream)
return read1(stream)
}
var read = read1

@@ -166,3 +165,3 @@ var sink = function (stream, cb) {

var source = function (stream) {
return pull.Source(function () { return read(stream) })()
return pull.Source(function () { return read1(stream) })()
}

@@ -172,8 +171,8 @@

return (
stream.writable
(stream.writable && stream.write)
? stream.readable
? pull.Through(function(_read) {
write(_read, stream, cb);
return read(stream)
})()
write(_read, stream, cb);
return read1(stream)
})()
: sink(stream, cb)

@@ -180,0 +179,0 @@ : source(stream)

{
"name": "stream-to-pull-stream",
"description": "convert a stream1 or streams2 stream into a pull-stream",
"version": "1.6.1",
"version": "1.6.2",
"homepage": "https://github.com/dominictarr/stream-to-pull-stream",

@@ -11,3 +11,4 @@ "repository": {

"dependencies": {
"pull-core": "~1.0.0"
"pull-core": "~1.0.0",
"pull-stream": "^2.27.0"
},

@@ -14,0 +15,0 @@ "devDependencies": {

@@ -16,4 +16,6 @@ var pull = require('pull-stream')

})
pull.infinite()
.pipe(function (read) {
pull(
pull.infinite(),
function (read) {
return function (abort, cb) {

@@ -23,6 +25,7 @@ if(abort) return t.ok(true), t.end()

}
})
.pipe(toPull(ts))
.pipe(pull.drain())
},
toPull(ts),
pull.drain()
)
})
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