# 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:

  1. Go to Add more nodes option on the palette section.
  2. Check for the ZIP node and click install.
  3. Once installed, the designer is required to be restarted.

To install the node from CLI:

  1. Go to your project workspace where you can see your package.json file.
  2. Run the below give npm command.
    npm i @kumologica/kumologica-contrib-zip

# Technical Details

Properties

  • Filename (Optional)
    Name of the file with extension. In AddFile 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. In Extract or Inspect 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 in AddFile operation.

Supported Operations

  • AddFile
    AddFile operation will add individual file into for compression. This operation is called before Compress operation.
  • Compress
    Compress operation will compress the files (added by the AddFile 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.