
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
grunt-contrib-compress
Advanced tools
Compress files and folders (part of the grunt-contrib collection). Submitted by Chris Talkington.
Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-contrib-clean
Then add this line to your project's grunt.js
gruntfile:
grunt.loadNpmTasks('grunt-contrib-compress');
Inside your grunt.js
file, add a section named compress
. This section specifies the files to compress and the options passed to either zipstream (for zip) or tar (for tar/tgz) or zlib (for gzip).
object
This defines what files this task will compress and should contain key:value pairs.
The key (destination) should be an unique filepath (supports grunt.template) and the value (source) should be a filepath or an array of filepaths (supports minimatch).
object
This controls how this task operates and should contain key:value pairs, see options below.
string
This is used to define which mode to use, currently supports gzip, tar, tgz (tar gzip) and zip.
string
This option adjusts internal filenames to be relative to provided path, within the resulting archive file.
boolean
This option performs a flat copy that dumps all the files into the root of the destination file, overwriting files if they exist.
integer
(zip only)This option sets the level of archive compression (defaults to 1).
Currently, gzip compression related options are not supported due to deficiencies in node's zlib library.
compress: {
zip: {
options: {
mode: "zip",
basePath: "path/to",
level: 1
},
files: {
"path/to/result.zip": "path/to/source/*", // includes files in dir
"path/to/another.gz": "path/to/source/**", // includes files in dir and subdirs
"path/to/final.zip": ["path/to/sources/*.js", "path/to/more/*.js"], // include JS files in two diff dirs
"path/to/project-<%= pkg.version %>.zip": "path/to/source/**" // variables in destination
}
}
tar: {
options: {
mode: "tar",
basePath: "path/to"
},
files: {
"path/to/result.tar": "path/to/file.ext"
}
},
tgz: {
options: {
mode: "tgz",
basePath: "path/to"
},
files: {
"path/to/result.tgz": "path/to/file.ext"
}
},
gzip: {
options: {
mode: "gzip"
},
files: {
"path/to/result.gz": "path/to/file.ext"
}
}
}
FAQs
Compress files and folders
The npm package grunt-contrib-compress receives a total of 39,384 weekly downloads. As such, grunt-contrib-compress popularity was classified as popular.
We found that grunt-contrib-compress demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.