Represents an instance used to create an unzipped stream.
This example will take a zip file, decompress it and then save its files and directories to disk.
import {resolve} from "https://deno.land/std/path/mod.ts";import {ensureDir, ensureFile} from "https://deno.land/std/fs/mod.ts";for await (const entry of (await fetch(urlToZippedFile)).body.pipeThrough(new ZipReaderStream())) { const fullPath = resolve(destination, entry.filename); if (entry.directory) { await ensureDir(fullPath); continue; } await ensureFile(fullPath); await entry.readable?.pipeTo((await Deno.create(fullPath)).writable);} Copy
import {resolve} from "https://deno.land/std/path/mod.ts";import {ensureDir, ensureFile} from "https://deno.land/std/fs/mod.ts";for await (const entry of (await fetch(urlToZippedFile)).body.pipeThrough(new ZipReaderStream())) { const fullPath = resolve(destination, entry.filename); if (entry.directory) { await ensureDir(fullPath); continue; } await ensureFile(fullPath); await entry.readable?.pipeTo((await Deno.create(fullPath)).writable);}
Creates the stream.
Optional
The options.
The readable stream.
The writable stream.
Represents an instance used to create an unzipped stream.
Example
This example will take a zip file, decompress it and then save its files and directories to disk.