Merge pull request #13 from thlorenz/consistent-stream-implementation
using readable stream no matter what node version
This commit is contained in:
commit
d661f7f913
2 changed files with 7 additions and 8 deletions
|
@ -1,10 +1,9 @@
|
|||
var stream = require('stream');
|
||||
var util = require('util');
|
||||
var bl = require('bl');
|
||||
var headers = require('./headers');
|
||||
|
||||
var Writable = stream.Writable || require('readable-stream').Writable;
|
||||
var PassThrough = stream.PassThrough || require('readable-stream').PassThrough;
|
||||
var Writable = require('readable-stream').Writable;
|
||||
var PassThrough = require('readable-stream').PassThrough;
|
||||
|
||||
var noop = function() {};
|
||||
|
||||
|
|
10
pack.js
10
pack.js
|
@ -1,10 +1,10 @@
|
|||
var stream = require('stream');
|
||||
var util = require('util');
|
||||
var eos = require('end-of-stream');
|
||||
var headers = require('./headers');
|
||||
|
||||
var Readable = stream.Readable || require('readable-stream').Readable;
|
||||
var Writable = stream.Writable || require('readable-stream').Writable;
|
||||
var Readable = require('readable-stream').Readable;
|
||||
var Writable = require('readable-stream').Writable;
|
||||
var PassThrough = require('readable-stream').PassThrough;
|
||||
|
||||
var END_OF_TAR = new Buffer(1024);
|
||||
END_OF_TAR.fill(0);
|
||||
|
@ -86,7 +86,7 @@ Pack.prototype.entry = function(header, buffer, callback) {
|
|||
}
|
||||
|
||||
this._encode(header);
|
||||
this._stream = stream;
|
||||
this._stream = new PassThrough();
|
||||
|
||||
var sink = new Sink(this);
|
||||
|
||||
|
@ -174,4 +174,4 @@ Pack.prototype._read = function(n) {
|
|||
drain();
|
||||
};
|
||||
|
||||
module.exports = Pack;
|
||||
module.exports = Pack;
|
||||
|
|
Loading…
Reference in a new issue