kevva / kevva/decompress

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

Open
#58 0 comments 6 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
419
Forks
55
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Compare decompress's input handling with the stream-capable plugin APIs, especially decompress-tar and decompress-targz. Determine the intended behavior when a single plugin is explicitly selected and how automatic type detection is affected; done means the stream API and its memory-use expectations are consistent and documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.