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 util = require('util');
|
||||||
var bl = require('bl');
|
var bl = require('bl');
|
||||||
var headers = require('./headers');
|
var headers = require('./headers');
|
||||||
|
|
||||||
var Writable = stream.Writable || require('readable-stream').Writable;
|
var Writable = require('readable-stream').Writable;
|
||||||
var PassThrough = stream.PassThrough || require('readable-stream').PassThrough;
|
var PassThrough = require('readable-stream').PassThrough;
|
||||||
|
|
||||||
var noop = function() {};
|
var noop = function() {};
|
||||||
|
|
||||||
|
|
8
pack.js
8
pack.js
|
@ -1,10 +1,10 @@
|
||||||
var stream = require('stream');
|
|
||||||
var util = require('util');
|
var util = require('util');
|
||||||
var eos = require('end-of-stream');
|
var eos = require('end-of-stream');
|
||||||
var headers = require('./headers');
|
var headers = require('./headers');
|
||||||
|
|
||||||
var Readable = stream.Readable || require('readable-stream').Readable;
|
var Readable = require('readable-stream').Readable;
|
||||||
var Writable = stream.Writable || require('readable-stream').Writable;
|
var Writable = require('readable-stream').Writable;
|
||||||
|
var PassThrough = require('readable-stream').PassThrough;
|
||||||
|
|
||||||
var END_OF_TAR = new Buffer(1024);
|
var END_OF_TAR = new Buffer(1024);
|
||||||
END_OF_TAR.fill(0);
|
END_OF_TAR.fill(0);
|
||||||
|
@ -86,7 +86,7 @@ Pack.prototype.entry = function(header, buffer, callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._encode(header);
|
this._encode(header);
|
||||||
this._stream = stream;
|
this._stream = new PassThrough();
|
||||||
|
|
||||||
var sink = new Sink(this);
|
var sink = new Sink(this);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue