jsantell / jsantell/node-zip-dir
Singular file zipping vs multiple file zipping
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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