gulp-archiver2
Archive anything through gulp. Based on gulp-archiver, with the added ability to use archives persistently across tasks.
Thanks to @Fobos for his work on the original gulp-archiver
Usage
let gulp = ;let Archiver = ; gulp;
For persistent use across tasks
let gulp = ;let Archiver = ;let archive = "zip" gulp gulp gulp gulp; gulp; // Can handle files being added simultanously through parallel tasksgulp;
Plugin uses archiver npm package to make archive.
API
Archiver.create(fileOut[, options])
Consumes files and pushes an archive to the stream
fileOut
Required
Type: String
File name for the resulting archive. Must end with file extension indicating the format. Plugin supports only zip
, tar
, and tar.gz
archives.
options
Type: Object
Described in original archiver repository
new Archiver(format[, options])
let instance = Creates a persistent archive that can be used across tasks
format
Required
Type: String
Type of archive to create. Can be "zip"
, "tar"
, "tar.gz"
, or "tgz"
.
options
Type: Object
Described in original archiver repository
.add([path])
instanceAccepts files/folders and adds them to the archive
path
Type: String
Destination within the archive to place files. If left empty, files will be placed at the root of the file.
.close(fileOut)
instanceCloses archive and returns a Readable, which can be piped to gulp.dest
fileOut
Required
Type: String
Filename to output file to.