N/compress Module

Use the N/compress module to compress and decompress files. You can also use this module to archive multiple files in a single file archive such as TAR or ZIP file.

You can compress and decompress individual files by using compress.gzip(options) and compress.gunzip(options).

You can create an archive by using compress.createArchiver() and add multiple files to the archive.

                                   

In This Help Topic

N/compress Module Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Object

compress.Archiver

Object

Server scripts

The functionality for creating archive files.

Use compress.createArchiver() to create this object.

Method

compress.createArchiver()

compress.Archiver

Server scripts

Creates a compress.Archiver object.

compress.gunzip(options)

file.File

Server scripts

Decompresses a file and returns it as a temporary file object.

compress.gzip(options)

file.File

Server scripts

Compresses a file and returns it as a temporary file object.

Enum

compress.Type

enum

Server scripts

Holds the string values for the archive types.

Archiver Object Members

The following members are called on the compress.Archiver object.

Member Type

Name

Return Type/Value Type

Supported Script Types

Description

Method

Archiver.add(options)

void

Server scripts

Adds a file to be archived.

Archiver.archive(options)

file.File

Server scripts

Creates an archive with the added files and returns it as a temporary file object.

Related Topics

General Notices