How to use the jszip/dist/jszip function in jszip

To help you get started, we’ve selected a few jszip examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github futurepress / epub.js / src / workers / epub.worker.js View on Github external
return entry.async("arraybuffer").then((file) => {
					let zipResponse = new Response(file, {
						"status" : 200,
						"headers": { 'Content-Type': mimeType }
					});
					let zipResponseClone = zipResponse.clone();
					caches.open(cacheName).then((cache) => {
						return cache.put(originalRequest.url, zipResponseClone);
					}).then(() => {
						console.log("from cached zip");
					});
					return zipResponse;
				});

		} else {
			this.zip = new JSZip();
			return fetch(url).then((epubResponse) => {
				return epubResponse.arrayBuffer();
			}).then((buffer) => {
				return this.zip.loadAsync(buffer);
			}).then(() => {
				entry = this.zip.file(path);
				mimeType = mime.lookup(entry.name);
				return entry.async("arraybuffer");
			}).then((file) => {
				let zipResponse = new Response(file, {
					"status" : 200,
					"headers": { 'Content-Type': mimeType }
				});
				let zipResponseClone = zipResponse.clone();
				caches.open(cacheName).then((cache) => {
					return cache.put(originalRequest.url, zipResponseClone);

jszip

Create, read and edit .zip files with JavaScript http://stuartk.com/jszip

(MIT OR GPL-3.0-or-later)
Latest version published 2 years ago

Package Health Score

80 / 100
Full package analysis