0.0.1 • Published 9 years ago

cordova-js-zip v0.0.1

Weekly downloads
2
License
Apache 2
Repository
github
Last release
9 years ago

cordova-js-zip

==========

Promises wrapper for Cordova zip library

Getting started

    # 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

Usage

    
    // 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('promiscuous') // 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.

Tests

npm test

Changelog

0.0.1 (20150415)

  • First version with unzip functionality

Licence

Apache 2