Skip to content

AsrarMemon/nativescript-zip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm npm Build Status

NativeScript Zip

Installation

tns plugin add nativescript-zip

Usage

Zip

import { Zip } from "nativescript-zip";
import * fs from "file-system";
let path = fs.path.join(fs.knownFolders.temp().path, "stuff");
let dest = fs.path.join(fs.knownFolders.currentApp().path, "/assets");
Zip.zip(path,dest);

Progress

import { Zip } from "nativescript-zip";
import * fs from "file-system";
let path = fs.path.join(fs.knownFolders.temp().path, "stuff");
let dest = fs.path.join(fs.knownFolders.currentApp().path, "/assets");
Zip.zipWithProgress(path,dest,onZipProgress);

function onZipProgress(percent: number) {
    console.log(`unzip progress: ${percent}`);
}

Unzip

import { Zip } from "nativescript-zip";
import * fs from "file-system";
let zipPath = fs.path.join(fs.knownFolders.temp().path, "stuff.zip");
let dest = fs.path.join(fs.knownFolders.currentApp().path, "/assets");
Zip.unzip(zipPath,dest);

Progress

import { Zip } from "nativescript-zip";
import * fs from "file-system";
let zipPath = fs.path.join(fs.knownFolders.temp().path, "stuff.zip");
let dest = fs.path.join(fs.knownFolders.currentApp().path, "/assets");
Zip.unzipWithProgress(zipPath,dest,onZipProgress);

function onZipProgress(percent: number) {
    console.log(`unzip progress: ${percent}`);
}

TODO

  • Compress method
  • Progress

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 91.9%
  • Shell 8.0%
  • Ruby 0.1%