ZIP compress files with Taskr.
$ npm install --save-dev @taskr/zip
This example will produce releases/Archive.zip
, containing all contents within the dist
directory:
// Option 1
exports.zip = function * (task) {
yield task.source('dist/**/*').zip({ file:'Archive.zip' }).target('releases');
}
//=> only writes ZIP file to 'releases' dir
// Option 2
exports.zip = function * (task) {
yield task.source('dist/**/*').zip({
file: 'Archive.zip',
dest: '.'
}).target('releases');
}
//=> writes all files to 'releases'
//=> also writes ZIP file to root dir
Type: string
Default: null
If specified, is an alternate directory wherein the ZIP file should be placed. This should only be used if you'd like to write to a location other than your task.target()
location.
Important: By providing a
dest
value, the files fromtask.source()
will be preserved and remain accessible within the task-chain!
Type: string
Default: 'archive.zip'
The name of your ZIP file. It must include .zip
.
Any issues or questions can be sent to the Taskr monorepo.
Please be sure to specify that you are using @taskr/zip
.
MIT © Luke Edwards