tns plugin add nativescript-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);
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}`);
}
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);
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}`);
}
- Compress method
- Progress