Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hyp3rflow/zipland

Serve file server with single zip file as file system in Deno.
https://github.com/hyp3rflow/zipland

deno file-server zip

Last synced: 6 days ago
JSON representation

Serve file server with single zip file as file system in Deno.

Awesome Lists containing this project

README

        

# zipland

Serve file server with one-single zip file in Deno.

## Support

### zip

- just zip32 with deflated or uncompressed

### serving

- plaintext
- deflate

## Examples

You can serve your zip file with just single line.

```typescript
import { serveZip } from "https://deno.land/x/zipland/mod.ts";

serveZip("./my.zip");
```

Or you can serve the zip file in your own serve implementation.

```typescript
import { serve } from "https://deno.land/std/http/mod.ts";
import {
disassembleZip,
serveZipFiles,
} from "https://deno.land/x/zipland/mod.ts";

const file = await Deno.open(path);
const zip = await disassembleZip(zip);
if (zip) {
const handler = (req: Request): Promise => {
const pathname = new URL(req.url).pathname;
switch (pathname) {
case "/file": {
return serveZipFiles(req, zip, { urlRoot: "/file" });
}
}
// serve other things too!
};
serve(handler);
}
```

You can see and run above example in `/test` directory