happy-opfs • Docs
happy-opfs / zip
function zip(
sourcePath,
zipFilePath,
options?): AsyncVoidIOResult
Zip a file or directory and write to a zip file.
Equivalent to zip -r <zipFilePath> <targetPath>
.
Use fflate as the zip backend.
Parameter | Type | Description |
---|---|---|
sourcePath |
string |
The path to be zipped. |
zipFilePath |
string |
The path to the zip file. |
options ? |
ZipOptions |
Options of zip. |
AsyncVoidIOResult
A promise that resolves to an AsyncIOResult
indicating whether the source was successfully zipped.
function zip(sourcePath, options?): AsyncIOResult<Uint8Array>
Zip a file or directory and return the zip file data.
Equivalent to zip -r <zipFilePath> <targetPath>
.
Use fflate as the zip backend.
Parameter | Type | Description |
---|---|---|
sourcePath |
string |
The path to be zipped. |
options ? |
ZipOptions |
Options of zip. |
AsyncIOResult
<Uint8Array
>
A promise that resolves to an AsyncIOResult
indicating whether the source was successfully zipped.