4.0.2 • Published 4 years ago

nativescript-zip v4.0.2

Weekly downloads
135
License
Apache-2.0
Repository
-
Last release
4 years ago

npm npm Build Status

NativeScript Zip

Installation

NativeScript 4x

  • tns plugin add nativescript-zip

NativeScript 2x & 3x

  • tns plugin add nativescript-zip@2.0.4

Usage

Zip

import { Zip } from "nativescript-zip";
import * as fs from "tns-core-modules/file-system";
let path = fs.path.join(fs.knownFolders.temp().path, "stuff");
let dest = fs.path.join(fs.knownFolders.documents().path, "/assets");
Zip.zip({
    folder: path,
    destination: dest
});

Progress

import { Zip } from "nativescript-zip";
import * as fs from "tns-core-modules/file-system";
let path = fs.path.join(fs.knownFolders.temp().path, "stuff");
let dest = fs.path.join(fs.knownFolders.documents().path, "/assets");
Zip.zip({
    folder: path,
    destination: dest,
    onProgress: onZipProgress
});

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

Unzip

import { Zip } from "nativescript-zip";
import * as fs from "tns-core-modules/file-system";
let zipPath = fs.path.join(fs.knownFolders.temp().path, "stuff.zip");
let dest = fs.path.join(fs.knownFolders.documents().path, "/assets");
Zip.unzip({
    archive: zipPath,
    destination: dest
});

Progress

import { Zip } from "nativescript-zip";
import * as fs from "tns-core-modules/file-system";
let zipPath = fs.path.join(fs.knownFolders.temp().path, "stuff.zip");
let dest = fs.path.join(fs.knownFolders.documennts().path, "/assets");
Zip.unzip({
    archive: zipPath,
    destination: dest,
    onProgress: onUnZipProgress
});

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

TODO

  • Compress method
  • Progress
4.0.2

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago