Skip to content

Commit 8ea1ab7

Browse files
committed
Lock the streams implementation to Streams2
Uses the readable-stream module, pinned at 1.0.x (Streams2) rather than the node core stream module. Adds node 0.11 compatablity. See http://www.nearform.com/nodecrunch/dont-use-nodes-core-stream-module for more details.
1 parent bae8856 commit 8ea1ab7

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
language: node_js
22
node_js:
3+
- "0.11"
34
- "0.10"
45
- "0.8"
56

lib/entry.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22

33
module.exports = Entry;
44

5-
var PassThrough = require('stream').PassThrough;
5+
var PassThrough = require('readable-stream/passthrough');
66
var inherits = require('util').inherits;
77

8-
if (!PassThrough) {
9-
PassThrough = require('readable-stream/passthrough');
10-
}
11-
128
inherits(Entry, PassThrough);
139

1410
function Entry () {

lib/extract.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ module.exports = Extract;
44

55
var Parse = require("../unzip").Parse;
66
var Writer = require("fstream").Writer;
7-
var Writable = require('stream').Writable;
7+
var Writable = require('readable-stream/writable');
88
var path = require('path');
99
var inherits = require('util').inherits;
1010

11-
if (!Writable) {
12-
Writable = require('readable-stream/writable');
13-
}
14-
1511
inherits(Extract, Writable);
1612

1713
function Extract (opts) {

lib/parse.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@
33
module.exports = Parse.create = Parse;
44

55
require("setimmediate");
6-
var Transform = require('stream').Transform;
6+
var Transform = require('readable-stream/transform');
77
var inherits = require('util').inherits;
88
var zlib = require('zlib');
99
var binary = require('binary');
1010
var PullStream = require('pullstream');
1111
var MatchStream = require('match-stream');
1212
var Entry = require('./entry');
1313

14-
if (!Transform) {
15-
Transform = require('readable-stream/transform');
16-
}
17-
1814
inherits(Parse, Transform);
1915

2016
function Parse(opts) {

0 commit comments

Comments
 (0)