Skip to content

cla/zip - Local zip files management

These functions are for managing zip files located in the Clarive server instance filesystem.


List contents of a zip file. It returns an array of { file, size, date } objects

var zip = require('cla/zip');

zip.compress(file, contents, basepath, overwrite)

Adds files in the contents array to the zip archive specified in file cutting the contents paths from the basepath specified in the third parameter. If the zip file already exists, it will append/modify the contents unless you specified 1 in the forth parameter. In that case, it will create a new zip file.

var zip = require('cla/zip');

zip.unCompress(file, path)

Uncompress archive file in the destination path

var zip = require('cla/zip');