#3869 - Unzip federal restrictions file #4030
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This draft PR contains the work related to finding a suitable library to perform the unzip for the federal restrictions file imported from the SFTP server.
Throughout my initial investigation, I tried to use the
node:zlib
library provided as a part of the corenodejs
package. However, I ran into a few issues and it seems that this particular library works with thegzip
compression formats and not with thezip
formats.I ran into the below error during the implementation:
As per my current understanding, we might have to use a 3rd party library to achieve the desired result.
Some other libraries for the task:
https://stackoverflow.com/questions/10308110/simplest-way-to-download-and-unzip-files-in-node-js-cross-platform
Other useful references used during development:
https://github.com/theophilusx/ssh2-sftp-client?tab=readme-ov-file#getpath-dst-options--stringstreambuffer
https://stackoverflow.com/questions/72684271/read-a-file-buffer-from-zip-file-buffer-data-in-nodejs
https://stackoverflow.com/questions/11611950/unzip-a-zip-file-using-zlib