cordova-js-zip

0.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i cordova-js-zip

Weekly Downloads

1

Version

0.0.1

License

Apache 2

Last publish

Collaborators

  • albin.gray