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.4.0 to 1.4.1

7

index.js

@@ -44,6 +44,7 @@ var pull = require('pull-core')

if(end === true)
return stream._isStdio || stream.end()
return stream._isStdio ? done() : stream.end()
if(ended = ended || end) {
if(stream.destroy) stream.destroy()
else return cb(ended)
stream.destroy && stream.destroy()
return done(ended)
}

@@ -50,0 +51,0 @@ var pause = stream.write(data)

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

@@ -6,0 +6,0 @@ "repository": {

var pull = require('pull-stream')
var fs = require('fs')
var tape = require('tape')
var toPullStream = require('../')
pull.values([
'hello\n',
' there\n'
])
.pipe(toPullStream(process.stdout))
pull(
pull.values([
'hello\n',
' there\n'
]),
toPullStream(process.stdout)
)
toPullStream(fs.createReadStream(__filename))
.pipe(pull.map(function (e) { return e.toString().toUpperCase() }))
.pipe(toPullStream(process.stdout))
tape('get end callback even with stdout', function (t) {
pull(
toPullStream(fs.createReadStream(__filename)),
pull.map(function (e) { return e.toString().toUpperCase() }),
toPullStream.sink(process.stdout, function (err) {
console.log('----END!')
t.end()
})
)
})

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

require('tape')('propagate close back to source', function (t) {
var tape = require('tape')
tape('propagate close back to source', function (t) {
// t.plan(4)

@@ -18,2 +20,3 @@

})
pull(

@@ -25,4 +28,28 @@ pull.values([1,2,3]),

t.end()
}))
})
)
})
tape('error', function (t) {
var ts = through()
var err = new Error('wtf')
pull(
pull.values([1,2,3]),
function (read) {
return function (abort, cb) {
read(abort, function (end, data) {
if(data === 3) cb(err)
else cb(end, data)
})
}
},
toPull.sink(ts, function (_err) {
t.equal(_err, err)
t.end()
})
)
})
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