jsantell / jsantell/node-zip-dir

Singular file zipping vs multiple file zipping

Open
#16 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
47
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Hi there i noticed a very small inconsistency with the zipping of a given directory, I noticed that if you zip a directory with a singular file, there is no inner folder in the given zip. Whereas if you have multiple files in a directory the files in a directory are wrapped by an overall folder, with the original folders name. So as an example:

Directory (Single File):

├───DirectoryBeingZippedWIthSingleFIles
│   ├───test.txt

If you were to unzip the generated zip for the above, it gives you just the file i.e test.txt.

Directory (Multiple Files):

├───DirectoryBeingZippedWithMultipleFiles
│   ├───test.txt
│   ├───test.txt

If you were to unzip the generated zip for the above, it gives you the files but wrapped in a folder called DirectoryBeingZippedWithMultipleFiles

Proposed Solution

So the idea, which i have implemented locally, is to allow a option to be passed into the set of options, which allows you to specify the inner folder name, and as such be able to provide a name for when there is only a singular file.

This was a small issue in a project where we had to do some zipping and unzipping of directories, where the output format was not consistent when the directory sizes were not consistent. And as mentioned, i have implemented this locally, but raising issue for further discussion. :)

Contributor guide

No contributing guide indexed for this repository

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

The issue names no files or tests. Start by locating the directory-zipping entry point and reproduce the single-file and multiple-file examples; done means an option can consistently provide the intended inner folder name for both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.