# ZIP
Category: File
| Runtime: 2.1+
| Available: Free
# Overview
Zip node will help in compressing multiple files into a zip file or to extract the files from a given zip file.
# Setup
# Prerequisites
Not applicable
# Installation
To install the node from designer:
- Go to Add more nodes option on the palette section.
- Check for the ZIP node and click install.
- Once installed, the designer is required to be restarted.
To install the node from CLI:
- Go to your project workspace where you can see your
package.json
file. - Run the below give npm command.
npm i @kumologica/kumologica-contrib-zip
# Technical Details
Properties
- Filename (Optional)
Name of the file with extension. InAddFile
operation if the file is provided with a path the zipped folder will create a folder and place the file accordingly. - Content (Optional)
Buffer content or string content which can be added to a file. InExtract
orInspect
operation the Content should be a buffer of the zip file which will be extracted or inspected. - Comment (Optional)
Comment provided when adding the content to a file. This is only applicable inAddFile
operation.
Supported Operations
- AddFile
AddFile operation will add individual file into for compression. This operation is called beforeCompress
operation. - Compress
Compress operation will compress the files (added by theAddFile
operation) into a single zip file. - Extract
Extract operation will extract individual files from a given zip file. - Inspect
Inspect operation will provide the meta data for the files within a given zip file.
Throws
ZIP node throws the following exception.
- ZipCompressionError
- ZipExtractionError
- ZipInspectError
- ZipFileLocationError
- ZipNoContentError
Returns
The node returns buffer object for Compress operation. For Inspect and Extract operation the payload will be an object with zip file metadata and file content. Payload from the node is not overwritten by the AddFile operation as the this node will have special zip instance object under msg.zip
.