==========
Promises wrapper for [Cordova zip library] (https://github.com/MobileChromeApps/zip)
# npm install component
npm install cordova-js-zip
# install Cordova and plugins
cordova platform add ios@3.7.0
cordova plugin add org.apache.cordova.file
cordova plugin add https://github.com/MobileChromeApps/zip.git
// require
var zipUtil = require('cordova-js-zip');
var zip = zipUtil({
retryCount: 3, // How many times to retry unzip if it fails (default is 1)
Zip: window.zip // The zip library
Promise: require('q') // Promise/A+ library
});
zip.unzip(src, dest, options) // unzip src zip file to dest directory
options.retryCount = 5 // retry unzip for 5 times before failing (defaults to 1)
The Promise option expects a library that follows the Promise/A+ spec, such as Q (github).
The Zip option expects the Cordova zip library or something that implements the same API.
npm test
- First version with unzip functionality
Apache 2