Lightweight asynchronous promise-based wrapper for archive generation.
Promise-based wrapper based on Q and Archiver supporting asynchronous archive generation.
With npm do:
npm install q-archiver --save
var QArchiver = require('q-archiver'),
archive = new QArchiver('output.zip'); // Optional archive type parameter can be passed. Defaults to 'zip'
archive
.bulk([{ expand: true, cwd: 'fixtures/', src: '*' }])
.then(function(result){
// Do something with archive file
})
.catch(function(){
// Handle any errors from any of the above steps
})
.done();
Initialise a QArchiver
object that will output an archived file in filepath
. Optional format
and options
are used to internally create an Archiver
object using its default constructor of
Archiver(format, options)
.
An asynchronous wrapper method for Archiver.bulk(mappings
that returns a promise.
MIT