Skip to content

Latest commit

 

History

History
67 lines (42 loc) · 1.71 KB

zip.md

File metadata and controls

67 lines (42 loc) · 1.71 KB

happy-opfsDocs


happy-opfs / zip

Function: zip()

zip(sourcePath, zipFilePath, options)

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.

Parameters

Parameter Type Description
sourcePath string The path to be zipped.
zipFilePath string The path to the zip file.
options? ZipOptions Options of zip.

Returns

AsyncVoidIOResult

A promise that resolves to an AsyncIOResult indicating whether the source was successfully zipped.

Defined in

fs/opfs_zip.ts:49

zip(sourcePath, options)

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.

Parameters

Parameter Type Description
sourcePath string The path to be zipped.
options? ZipOptions Options of zip.

Returns

AsyncIOResult<Uint8Array>

A promise that resolves to an AsyncIOResult indicating whether the source was successfully zipped.

Defined in

fs/opfs_zip.ts:60