Comparing version 0.6.1 to 0.7.0
@@ -10,2 +10,3 @@ /** | ||
var Transform = require('stream').Transform || require('readable-stream').Transform; | ||
var zlib = require('zlib'); | ||
@@ -18,7 +19,13 @@ var headers = require('./headers'); | ||
recordSize: 512, | ||
recordsPerBlock: 20 | ||
recordsPerBlock: 20, | ||
gzip: false | ||
}); | ||
if (typeof options.gzipOptions !== 'object') { | ||
options.gzipOptions = {}; | ||
} | ||
Transform.call(this, options); | ||
this.compressor = false; | ||
this.offset = 0; | ||
@@ -29,2 +36,6 @@ this.files = []; | ||
this.blockSize = options.recordsPerBlock * options.recordSize; | ||
if (options.gzip) { | ||
this.compressor = zlib.createGzip(options.gzipOptions); | ||
} | ||
}; | ||
@@ -101,2 +112,10 @@ | ||
return Transform.prototype.write.call(this, chunk, cb); | ||
}; | ||
Tar.prototype.pipe = function(destination, options) { | ||
if (this.compressor) { | ||
return Transform.prototype.pipe.call(this, this.compressor).pipe(destination, options); | ||
} else { | ||
return Transform.prototype.pipe.call(this, destination, options); | ||
} | ||
}; |
{ | ||
"name": "archiver", | ||
"version": "0.6.1", | ||
"version": "0.7.0", | ||
"description": "Creates Archives (ZIP) via Node Streams.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/ctalkington/node-archiver", |
@@ -1,5 +0,7 @@ | ||
# Archiver v0.6.1 [![Build Status](https://secure.travis-ci.org/ctalkington/node-archiver.png?branch=master)](http://travis-ci.org/ctalkington/node-archiver) | ||
# Archiver v0.7.0 [![Build Status](https://travis-ci.org/ctalkington/node-archiver.svg?branch=master)](https://travis-ci.org/ctalkington/node-archiver) | ||
Creates Archives (Zip, Tar) via Node Streams. | ||
[![NPM](https://nodei.co/npm/archiver.png)](https://nodei.co/npm/archiver/) | ||
## Install | ||
@@ -130,2 +132,10 @@ | ||
#### gzip `boolean` | ||
Compresses the tar archive using gzip, default is false. | ||
#### gzipOptions `object` | ||
Passed to node's [zlib](http://nodejs.org/api/zlib.html#zlib_options) module to control compression. Options may vary by node version. | ||
### File Data | ||
@@ -132,0 +142,0 @@ |
Sorry, the diff of this file is not supported yet
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
75833
1514
167