Extraction events
- Dominant language
- JavaScript
- Stars
- 419
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
A nice addition to this package would be emitting events such as `progress` and `entry` so that implementers can see how far along they are with their decompression and to know what the currently decompressing or decompressed file is.
```
const zip = new Decompress()
.src(src)
.dest(dest)
.use(Decompress.zip())
.on('progress', pe => {
if (pe.lengthComputable) {
const percent = Math.round(pe.decompressed / pe.total * 100);
console.log(`${percent}% complete`);
}
})
.on('entry', entry => {
console.log(`Currently decompressing ${entry.fileName}.`);
})
.run();
```
The `progress` event data I modeled after the Web API standard: https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent and modified `loaded` to `decompressed`.
The `entry` event data I modeled after information found in the zip specification on wikipedia.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the Decompress chain and the Decompress.zip() entry point named in the issue, then inspect how extraction currently reports work. Define the progress and entry event data from the Web API ProgressEvent and zip-specification references, and verify that consumers can observe decompression progress and the current file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100