I tried to use asUnit8Array() method in jsZip 3.0, I received the error "Error: This method has been removed in JSZip 3.0, please check the upgrade guide." but unfortunately there is not much info on the upgrade document.
I am working on tizen applications, and trying to unzip a file in memory and save back the unzipped content (several files) into tizen filesystem.
is there any alternative way to read the unzipped content and convert them to blob object to save them into file system?
The upgrade guide give the following example:
// 2.x
zip.file("test.txt").asText();
// 3.x
zip.file("test.txt").async("string")
.then(function (content) {
// use content
});
The method asUnit8Array follows the same migration path as asText:
// 2.x
zip.file("data.bin").asUnit8Array();
// 3.x
zip.file("data.bin").async("uint8array")
.then(function (content) {
// use content
});
If you whish to get a Blob object, you can directly use .async("blob") with JSZip v3.
Most helpful comment
The upgrade guide give the following example:
The method
asUnit8Arrayfollows the same migration path asasText:If you whish to get a Blob object, you can directly use
.async("blob")with JSZip v3.