Skip to content

hayd/deno-zip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deno zip

A wrapper around JSZip for deno.

Usage:

Create zipfile:

import { JSZip } from "https://deno.land/x/jszip/mod.ts";

const zip = new JSZip();
zip.addFile("Hello.txt", "Hello World\n");

const img = zip.folder("images");
img.addFile("smile.gif", "\0", { base64: true });

await zip.writeZip("example.zip");

Read zipfile:

import { readZip } from "https://deno.land/x/jszip/mod.ts";

const zip = await readZip("example.zip");
for (const z of zip) {
  console.log(z.name);
}

console.log(await zip.file("Hello.txt").async("string"));
// "Hello World\n"