ZipUtils
Import :
const ZipUtils = brackets.getModule("utils/ZipUtils")
unzipBinDataToLocation(zipData, projectDir, flattenFirstLevel, [progressControlCallback]) ⇒ Promise
Extracts a given binary zip data array to a specified location.
Kind: global function
Returns: Promise
- - A promise that resolves when extraction is complete.
Param | Type | Default | Description |
---|---|---|---|
zipData | UInt8Array | Binary zip data. | |
projectDir | string | Directory to extract to. | |
flattenFirstLevel | boolean | false | If set to true, then if zip contents are nested inside a directory, the nested directory will be removed in the path structure in the destination. For example, some zip may contain a contents folder inside the zip which has all the files. If we blindly extract the zip, all the contents will be placed inside a contents folder in the root instead of the root directory itself. See a sample zip file here: https://api.github.com/repos/StartBootstrap/startbootstrap-grayscales/zipball |
[progressControlCallback] | function | A function that can be used to view the progress and stop further extraction. The function will be invoked with (doneCount, totalCount). The function should return false if further extraction needs to be stopped. If nothing or true is returned, it will continue extraction. |
zipFolder(fullPath) ⇒ Promise.<JSZip>
Zips a given folder located at path to a jsZip object.
Kind: global function
Returns: Promise.<JSZip>
- zip object
Param | Type | Description |
---|---|---|
fullPath | string | to zip |
unzipURLToLocation(url, projectDir, flattenFirstLevel) ⇒ Promise
Kind: global function
Param | Default | Description |
---|---|---|
url | the zip fle URL | |
projectDir | To extract to | |
flattenFirstLevel | false | if set to true, then if zip contents are nested inside a directory, the nexted dir will be removed in the path structure in destination. For Eg. some Zip may contain a contents folder inside the zip which has all the contents. If we blindly extract the zio, all the contents will be placed inside a contents folder in root and not the root dir itself. See a sample zip file here: https://api.github.com/repos/StartBootstrap/startbootstrap-grayscales/zipball |