pullstream
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "pullstream", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "A stream you can pull data from.", | ||
@@ -28,4 +28,5 @@ "main": "pullstream.js", | ||
"over": "~0.0.5", | ||
"readable-stream": "0.0.3" | ||
"readable-stream": "~0.2.0", | ||
"setimmediate": "~1.0.1" | ||
} | ||
} |
@@ -5,6 +5,11 @@ 'use strict'; | ||
require("setimmediate"); | ||
var inherits = require("util").inherits; | ||
var PassThrough = require('readable-stream/passthrough'); | ||
var PassThrough = require('stream').PassThrough; | ||
var over = require('over'); | ||
if (!PassThrough) { | ||
PassThrough = require('readable-stream/passthrough'); | ||
} | ||
function PullStream(opts) { | ||
@@ -17,3 +22,3 @@ var self = this; | ||
if (self._flushed) { | ||
process.nextTick(self._finish.bind(self)); | ||
self._finish(); | ||
} | ||
@@ -92,13 +97,11 @@ }); | ||
if (this._readableState.length > 0) { | ||
return process.nextTick(self._flush.bind(self, outputFn, callback)); | ||
return setImmediate(self._flush.bind(self, outputFn, callback)); | ||
} | ||
this._flushed = true; | ||
return process.nextTick(function() { | ||
if (self._writesFinished) { | ||
self._finish(callback); | ||
} else { | ||
callback(); | ||
} | ||
}); | ||
if (self._writesFinished) { | ||
self._finish(callback); | ||
} else { | ||
callback(); | ||
} | ||
}; | ||
@@ -105,0 +108,0 @@ |
@@ -7,2 +7,4 @@ pullstream | ||
[![Build Status](https://travis-ci.org/nearinfinity/node-pullstream.png)](https://travis-ci.org/nearinfinity/node-pullstream) | ||
## Quick Examples | ||
@@ -9,0 +11,0 @@ |
@@ -263,4 +263,4 @@ 'use strict'; | ||
"throw on calling data or end after end": function (t) { | ||
t.expect(2); | ||
"throw on calling write() after end": function (t) { | ||
t.expect(1); | ||
var ps = new PullStream({ lowWaterMark : 0 }); | ||
@@ -276,9 +276,2 @@ ps.end(); | ||
try { | ||
ps.end(new Buffer('hello', 'utf8')); | ||
t.fail("should throw error"); | ||
} catch (ex) { | ||
t.ok(ex); | ||
} | ||
t.done(); | ||
@@ -285,0 +278,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19508
10
157
3
371
1
+ Addedsetimmediate@~1.0.1
+ Addedreadable-stream@0.2.0(transitive)
+ Addedsetimmediate@1.0.5(transitive)
- Removedreadable-stream@0.0.3(transitive)
Updatedreadable-stream@~0.2.0