Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zlib module #376

Closed
KluVerKamp opened this issue May 2, 2019 · 4 comments
Closed

Zlib module #376

KluVerKamp opened this issue May 2, 2019 · 4 comments

Comments

@KluVerKamp
Copy link
Contributor

Is there any plans to create a module to zip/unzip files and folder?

@axetroy
Copy link
Contributor

axetroy commented May 3, 2019

deno_std refers to golang std to achieve.

So this should be part of the plan.

  • deno_std/archive
    • tar
    • zip

If you or someone else is interested, welcome PR.

@arcatdmz
Copy link
Contributor

arcatdmz commented May 9, 2019

I have ported a simple JavaScript-based tar archiver to Deno during my effort to implement a web server.
https://github.com/arcatdmz/danoweb/blob/71bec75f7baea33fc320b09171a7bde4763037b6/server/tar.ts

There are multiple variations in tar format and it currently only supports USTAR but the other two popular formats (PAX and GNU). Still, could it be a small starting point? I could implement a bit more (e.g., Reader-based deflating method, GNU format support) and send a PR.

[Update] Now the implementation is updated to use reader/writer instead of just returning Uint8Array, allowing far more efficient memory use.
https://github.com/arcatdmz/danoweb/blob/b2f81e68f26d91e2f89c4ffe2a7277a24e2cef91/server/tar.ts

@barthuijgen
Copy link

For my project I need to parse a gzip compressed http response, but sadly I found absolutely no way to complete this task in Deno even when allowing hacky solutions, zip is not implemented and I could not spawn a child process to use a external program either.

The nodejs method would be zlib.createGunzip()

Seeing how you wish to port the go std, this would be the one: https://github.com/golang/go/tree/master/src/archive/zip

@arcatdmz
Copy link
Contributor

I was working on the port of pako library which allows binary equal output as the famous zlib implementations, while it is still on its way.

Probably I can have some time to do the rest (provide an API on top of the pako port) by the end of this month, but if you are in a hurry, you can find a working prototype here in my fork:
https://github.com/arcatdmz/deno_std/blob/feat-archive-zip/archive/pako

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants