grunt-contrib-compress
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -22,1 +22,7 @@ # Options | ||
*Currently, gzip compression related options are not supported due to deficiencies in node's zlib library.* | ||
## pretty | ||
Type: `Boolean` | ||
Default: `false` | ||
Pretty print file sizes when logging. |
{ | ||
"name": "grunt-contrib-compress", | ||
"description": "Compress files and folders.", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"homepage": "https://github.com/gruntjs/grunt-contrib-compress", | ||
@@ -33,3 +33,4 @@ "author": { | ||
"rimraf": "~2.0.2", | ||
"grunt-lib-contrib": "~0.5.1" | ||
"grunt-lib-contrib": "~0.5.1", | ||
"prettysize": "~0.0.2" | ||
}, | ||
@@ -36,0 +37,0 @@ "devDependencies": { |
@@ -16,3 +16,3 @@ # grunt-contrib-compress [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-compress.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-compress) | ||
One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: | ||
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: | ||
@@ -56,2 +56,8 @@ ```js | ||
#### pretty | ||
Type: `Boolean` | ||
Default: `false` | ||
Pretty print file sizes when logging. | ||
### Usage Examples | ||
@@ -78,2 +84,3 @@ | ||
* 2013-02-21 v0.4.1 Pretty print compressed sizes. Logging each addition to a compressed file now only happens in verbose mode. | ||
* 2013-02-14 v0.4.0 First official release for Grunt 0.4.0. | ||
@@ -92,2 +99,2 @@ * 2013-01-22 v0.4.0rc7 Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions. | ||
*This file was generated on Mon Feb 18 2013 08:36:30.* | ||
*This file was generated on Fri Feb 22 2013 09:14:59.* |
@@ -15,2 +15,3 @@ /* | ||
var rimraf = require('rimraf'); | ||
var prettySize = require('prettysize'); | ||
@@ -32,2 +33,9 @@ grunt.registerMultiTask('compress', 'Compress files.', function() { | ||
var pretty = function(size) { | ||
if (!options.pretty) { | ||
return size + ' bytes'; | ||
} | ||
return prettySize(size); | ||
}; | ||
var archiverOptions = options; | ||
@@ -94,3 +102,3 @@ | ||
archiveStream.on('close', function() { | ||
grunt.log.writeln('File ' + archiveFile.cyan + ' created (' + getSize(archiveFile) + ' bytes).'); | ||
grunt.log.writeln('File ' + archiveFile.cyan + ' created (' + pretty(getSize(archiveFile)) + ').'); | ||
done(); | ||
@@ -124,3 +132,3 @@ }); | ||
archive.addFile(fs.createReadStream(srcFile), { name: internalFileName }, function(err) { | ||
grunt.log.writeln('Archiving ' + srcFile.cyan + ' -> ' + archiveFile.cyan + '/'.cyan + internalFileName.cyan); | ||
grunt.verbose.writeln('Archiving ' + srcFile.cyan + ' -> ' + archiveFile.cyan + '/'.cyan + internalFileName.cyan); | ||
nextFile(err); | ||
@@ -136,5 +144,5 @@ }); | ||
if (shouldGzipTar) { | ||
grunt.log.writeln('Created ' + archiveFile.cyan + ' (' + getSize(archiveFile) + ' bytes)'); | ||
grunt.log.writeln('Created ' + archiveFile.cyan + ' (' + pretty(getSize(archiveFile)) + ')'); | ||
} else { | ||
grunt.log.writeln('Created ' + archiveFile.cyan + ' (' + written + ' bytes)'); | ||
grunt.log.writeln('Created ' + archiveFile.cyan + ' (' + pretty(written) + ')'); | ||
} | ||
@@ -178,2 +186,2 @@ | ||
}; | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
28649
253
97
1
5
+ Addedprettysize@~0.0.2
+ Addedprettysize@0.0.3(transitive)