grunt-contrib-compress
Advanced tools
Comparing version 1.6.0 to 2.0.0
{ | ||
"name": "grunt-contrib-compress", | ||
"description": "Compress files and folders", | ||
"version": "1.6.0", | ||
"version": "2.0.0", | ||
"author": { | ||
@@ -12,3 +12,3 @@ "name": "Grunt Team", | ||
"engines": { | ||
"node": ">=4.0" | ||
"node": ">=10.16" | ||
}, | ||
@@ -20,21 +20,25 @@ "main": "tasks/compress.js", | ||
"dependencies": { | ||
"archiver": "^1.3.0", | ||
"chalk": "^1.1.1", | ||
"lodash": "^4.7.0", | ||
"pretty-bytes": "^4.0.2", | ||
"stream-buffers": "^2.1.0" | ||
"adm-zip": "^0.5.1", | ||
"archiver": "^5.1.0", | ||
"chalk": "^4.1.0", | ||
"lodash": "^4.17.20", | ||
"pretty-bytes": "^5.4.1", | ||
"stream-buffers": "^3.0.2" | ||
}, | ||
"optionalDependencies": { | ||
"iltorb": "^2.4.3" | ||
}, | ||
"devDependencies": { | ||
"grunt": "^1.0.0", | ||
"grunt-contrib-clean": "^1.0.0", | ||
"grunt": "^1.3.0", | ||
"grunt-contrib-clean": "^2.0.0", | ||
"grunt-contrib-copy": "^1.0.0", | ||
"grunt-contrib-internal": "^4.0.1", | ||
"grunt-contrib-jshint": "^1.0.0", | ||
"grunt-contrib-nodeunit": "^1.0.0", | ||
"tar": "^4.4.8", | ||
"unzip": "^0.1.5" | ||
"grunt-contrib-internal": "^5.0.1", | ||
"grunt-contrib-jshint": "^3.0.0", | ||
"grunt-run": "^0.8.1", | ||
"jest": "^26.6.3", | ||
"tar": "^6.0.5" | ||
}, | ||
"jest": { | ||
"modulePathIgnorePatterns": [ | ||
"tmp", | ||
"test/fixtures" | ||
] | ||
}, | ||
"keywords": [ | ||
@@ -41,0 +45,0 @@ "gruntplugin", |
@@ -1,2 +0,2 @@ | ||
# grunt-contrib-compress v1.6.0 [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-compress.svg?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-compress) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/tiwbi1smm1j8aa5j/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt-contrib-compress/branch/master) | ||
# grunt-contrib-compress v2.0.0 [![Build Status](https://github.com/gruntjs/grunt-contrib-compress/workflows/Tests/badge.svg)](https://github.com/gruntjs/grunt-contrib-compress/actions?workflow=Tests) | ||
@@ -65,9 +65,14 @@ > Compress files and folders | ||
{ | ||
mode: 0, | ||
quality: 11, | ||
lgwin: 22, | ||
lgblock: 0 | ||
[zlib.constants.BROTLI_PARAM_MODE]: 0, | ||
[zlib.constants.BROTLI_PARAM_QUALITY]: 11, | ||
[zlib.constants.BROTLI_PARAM_LGWIN]: 22, | ||
[zlib.constants.BROTLI_PARAM_LGBLOCK]: 0 | ||
} | ||
``` | ||
Do not forget require `zlib` for `zlib.constants`, example: | ||
``` | ||
const zlib = require('zlib'); | ||
``` | ||
##### mode | ||
@@ -285,2 +290,3 @@ Type: `Integer` | ||
* 2020-12-12 v2.0.0 Remove iltorb dependency, now uses zlib brotli features. Requires node >=10.16. Dependency and test updates. | ||
* 2019-10-21 v1.6.0 Update iltorb dependency | ||
@@ -334,2 +340,2 @@ * 2018-04-24 v1.5.0 Update to node 4 as minimum version update tar to 4.4.8 | ||
*This file was generated on Mon Oct 21 2019 10:25:59.* | ||
*This file was generated on Sat Dec 12 2020 14:15:27.* |
@@ -14,10 +14,3 @@ /* | ||
var compress = require('./lib/compress')(grunt); | ||
var iltorb; | ||
try { | ||
iltorb = require('iltorb'); | ||
} catch (er) { | ||
iltorb = null; | ||
} | ||
grunt.registerMultiTask('compress', 'Compress files.', function() { | ||
@@ -42,7 +35,2 @@ compress.options = this.options({ | ||
if (compress.options.mode.match('brotli') && !iltorb) { | ||
grunt.fail.fatal('iltorb dependency wasn\'t found; in order to use brotli, ' + | ||
'make sure you have a supported C++ compiler available and run `npm install` again.'); | ||
} | ||
if (_.includes(['zip', 'tar', 'tgz', 'gzip', 'deflate', 'deflateRaw', 'brotli'], compress.options.mode) === false) { | ||
@@ -49,0 +37,0 @@ grunt.fail.warn('Mode ' + String(compress.options.mode) + ' not supported.'); |
@@ -20,10 +20,2 @@ /* | ||
var iltorb; | ||
try { | ||
iltorb = require('iltorb'); | ||
} catch (er) { | ||
iltorb = null; | ||
} | ||
module.exports = function(grunt) { | ||
@@ -68,3 +60,3 @@ | ||
exports.brotli = function(files, done) { | ||
exports.singleFile(files, iltorb.compressStream, 'br', done); | ||
exports.singleFile(files, zlib.createBrotliCompress, 'br', done); | ||
grunt.log.ok('Compressed ' + chalk.cyan(files.length) + ' ' + | ||
@@ -74,3 +66,3 @@ grunt.util.pluralize(files.length, 'file/files.')); | ||
// 1 to 1 compression of files, expects a compatible zlib or iltorb/brotli method to be passed in, see above | ||
// 1 to 1 compression of files, expects a compatible zlib method to be passed in, see above | ||
exports.singleFile = function(files, algorithm, extension, done) { | ||
@@ -117,10 +109,4 @@ grunt.util.async.forEachSeries(files, function(filePair, nextPair) { | ||
var compressor; | ||
var compressor = algorithm.call(zlib, exports.options); | ||
if (iltorb && extension === 'br') { | ||
compressor = algorithm.call(iltorb, exports.options.brotli); | ||
} else { | ||
compressor = algorithm.call(zlib, exports.options); | ||
} | ||
compressor.on('error', function(err) { | ||
@@ -127,0 +113,0 @@ grunt.log.error(err); |
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
339
25582
255
+ Addedadm-zip@^0.5.1
+ Addedadm-zip@0.5.16(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedarchiver@5.3.2(transitive)
+ Addedarchiver-utils@2.1.03.0.4(transitive)
+ Addedasync@3.2.6(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcompress-commons@4.1.2(transitive)
+ Addedcrc-32@1.2.2(transitive)
+ Addedcrc32-stream@4.0.3(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedlodash.defaults@4.2.0(transitive)
+ Addedlodash.difference@4.5.0(transitive)
+ Addedlodash.flatten@4.4.0(transitive)
+ Addedlodash.isplainobject@4.0.6(transitive)
+ Addedlodash.union@4.6.0(transitive)
+ Addedminimatch@5.1.6(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addedpretty-bytes@5.6.0(transitive)
+ Addedreaddir-glob@1.1.3(transitive)
+ Addedstream-buffers@3.0.3(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedzip-stream@4.1.1(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedaproba@1.2.0(transitive)
- Removedarchiver@1.3.0(transitive)
- Removedarchiver-utils@1.3.0(transitive)
- Removedare-we-there-yet@1.1.7(transitive)
- Removedasync@2.6.4(transitive)
- Removedbl@1.2.3(transitive)
- Removedbuffer-alloc@1.2.0(transitive)
- Removedbuffer-alloc-unsafe@1.1.0(transitive)
- Removedbuffer-fill@1.0.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedchownr@1.1.4(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedcompress-commons@1.2.2(transitive)
- Removedconsole-control-strings@1.1.0(transitive)
- Removedcrc@3.8.0(transitive)
- Removedcrc32-stream@2.0.0(transitive)
- Removeddecompress-response@4.2.1(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removeddelegates@1.0.0(transitive)
- Removeddetect-libc@1.0.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedexpand-template@2.0.3(transitive)
- Removedgauge@2.7.4(transitive)
- Removedgithub-from-package@0.0.0(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-unicode@2.0.1(transitive)
- Removediltorb@2.4.5(transitive)
- Removedini@1.3.8(transitive)
- Removedis-fullwidth-code-point@1.0.0(transitive)
- Removedmimic-response@2.1.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp-classic@0.5.3(transitive)
- Removednan@2.22.0(transitive)
- Removednapi-build-utils@1.0.2(transitive)
- Removednode-abi@2.30.1(transitive)
- Removednoop-logger@0.1.1(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removednpmlog@4.1.2(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedprebuild-install@5.3.6(transitive)
- Removedpretty-bytes@4.0.2(transitive)
- Removedpump@3.0.2(transitive)
- Removedrc@1.2.8(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
- Removedsemver@5.7.2(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedsimple-concat@1.0.1(transitive)
- Removedsimple-get@3.1.1(transitive)
- Removedstream-buffers@2.2.0(transitive)
- Removedstring-width@1.0.2(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedtar-fs@2.1.1(transitive)
- Removedtar-stream@1.6.2(transitive)
- Removedto-buffer@1.1.1(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedwalkdir@0.0.11(transitive)
- Removedwhich-pm-runs@1.1.0(transitive)
- Removedwide-align@1.1.5(transitive)
- Removedxtend@4.0.2(transitive)
- Removedzip-stream@1.2.0(transitive)
Updatedarchiver@^5.1.0
Updatedchalk@^4.1.0
Updatedlodash@^4.17.20
Updatedpretty-bytes@^5.4.1
Updatedstream-buffers@^3.0.2