max-mapper / max-mapper/extract-zip

Add a callback to onEntry that can be used to continue or cancel extraction

Open
#68 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
398
Forks
144
PR merge metrics
No merged PRs in 30d

Description

I have a need to inspect the contents of an archive and verify that it contains only certain file types.
I can supply an onEntry function in the options passed into extract to inspect the entry and check if it is allowed or not. However I do not see a way to signal back to extract-zip whether the extraction should continue or be cancelled. Ideally I want to use a library such as mmmagic to do deeper inspection where the result is returned in a callback.
It would be very useful if onEntry took a third parameter, a function, that could be called to continue/cancel the extraction.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the extract API and its onEntry handling, then trace how entries advance through extraction. Define how the third callback reports continue or cancel, including the asynchronous inspection case described in the issue, and verify that extraction stops or proceeds accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.