Skip to content

ihazar/nativescript-zip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm npm Build Status

NativeScript Zip

Installation

NativeScript 4x

  • tns plugin add nativescript-zip

NativeScript 2x & 3x

Usage

Zip

import { Zip } from "nativescript-zip";
import * as 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 * as 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 * as 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 * as 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 93.6%
  • Shell 6.3%
  • Ruby 0.1%