tar-stream
Advanced tools
Comparing version 1.0.2 to 1.1.1
@@ -16,4 +16,4 @@ var util = require('util') | ||
var emptyStream = function() { | ||
var s = new PassThrough() | ||
var emptyStream = function(self, offset) { | ||
var s = new Source(self, offset) | ||
s.end() | ||
@@ -29,2 +29,14 @@ return s | ||
var Source = function(self, offset) { | ||
this._parent = self | ||
this.offset = offset | ||
PassThrough.call(this) | ||
} | ||
util.inherits(Source, PassThrough) | ||
Source.prototype.destroy = function(err) { | ||
this._parent.destroy(err) | ||
} | ||
var Extract = function(opts) { | ||
@@ -34,2 +46,3 @@ if (!(this instanceof Extract)) return new Extract(opts) | ||
this._offset = 0 | ||
this._buffer = bl() | ||
@@ -90,2 +103,3 @@ this._missing = 0 | ||
var onheader = function() { | ||
var offset = self._offset | ||
var header | ||
@@ -124,7 +138,7 @@ try { | ||
self._parse(512, onheader) | ||
self.emit('entry', header, emptyStream(), onunlock) | ||
self.emit('entry', header, emptyStream(self, offset), onunlock) | ||
return | ||
} | ||
self._stream = new PassThrough() | ||
self._stream = new Source(self, offset) | ||
@@ -152,2 +166,3 @@ self.emit('entry', header, self._stream, onunlock) | ||
if (this._destroyed) return | ||
this._offset += size | ||
this._missing = size | ||
@@ -154,0 +169,0 @@ this._onparse = onparse |
{ | ||
"name": "tar-stream", | ||
"version": "1.0.2", | ||
"version": "1.1.1", | ||
"description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
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
20644
507