Skip to content

hadynz/q-archiver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Q archiver

Build Status

Lightweight asynchronous promise-based wrapper for archive generation.

About

Promise-based wrapper based on Q and Archiver supporting asynchronous archive generation.

Install

With npm do:

npm install q-archiver --save

Usage

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();

API

QArchiver(filepath, [format=zip], [options])

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).

.bulk(mappings)

An asynchronous wrapper method for Archiver.bulk(mappings that returns a promise.

License

MIT

About

Thin Q promise wrapper for Archiver

Resources

License

Stars

Watchers

Forks

Packages

No packages published