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

decompress and plugins are inconsistent about whether you can pass in a stream #58

Open
glasser opened this issue Jul 26, 2017 · 0 comments

Comments

@glasser
Copy link
Contributor

glasser commented Jul 26, 2017

Most decompress plugins allow input to be a stream. But decompress itself requires it to be a Buffer or a filename, and the filename is converted to a Buffer not a stream. I get that eg decompress-tar takes a stream because it might get one from decompress-targz, but it's unclear why decompress-targz (eg) is allowed to take a stream.

Moreover, it would be beneficial from a performance standpoint if you could pass in a stream to plugins like the tar ones that support it. Yes, it would mean that automatic type detection wouldn't work, but if you're explicitly specifying a single plugin like decompressTargz then that doesn't matter.

#57 at least will document explicitly that this package always reads the whole file into memory. But it would be nice if this package (with such a nice API) didn't waste so much memory.

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

2 participants
@glasser and others