JSZip

class JSZip(source)

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Get files matching a RegExp from archive

fun file(path: String): JSZipObject?

Get a file from the archive

fun file(name: String, data: ArrayBuffer, options: JSZipFileOptions? = definedExternally)
fun file(name: String, data: Uint8Array<*>, options: JSZipFileOptions? = definedExternally)
fun file(path: String, data: Void, options: JSZipFileOptions)
fun file(name: String, data: Blob, options: JSZipFileOptions? = definedExternally)

fun file(name: String, data: String, options: JSZipFileOptions? = definedExternally)

Add a file to the archive

Link copied to clipboard
fun filter(predicate: (relativePath: String, file: JSZipObject) -> Boolean): ReadonlyArray<JSZipObject>

Get all files which match the given filter function

Link copied to clipboard

Returns new JSZip instances with the matching folders as root

fun folder(name: String): JSZip?

Returns an new JSZip instance with the given folder as root

Link copied to clipboard
fun forEach(action: (relativePath: String, file: JSZipObject) -> Unit)

Call a callback function for each entry at this folder level.

Link copied to clipboard
inline suspend fun <T : JsAny> JSZip.generate(options: JSZipGeneratorOptions<T>): T
Link copied to clipboard
fun <T : JsAny> generateAsync(options: JSZipGeneratorOptions<T>, onUpdate: OnUpdateCallback? = definedExternally): Promise<T>

Generates a new archive asynchronously

Link copied to clipboard
inline suspend fun JSZip.load(data: ArrayBuffer, options: JSZipLoadOptions? = undefined): JSZip
inline suspend fun JSZip.load(data: Uint8Array<*>, options: JSZipLoadOptions? = undefined): JSZip
inline suspend fun JSZip.load(data: Blob, options: JSZipLoadOptions? = undefined): JSZip

inline suspend fun JSZip.load(data: String, options: JSZipLoadOptions? = undefined): JSZip

Deserialize zip file asynchronously

Link copied to clipboard
fun loadAsync(data: ArrayBuffer, options: JSZipLoadOptions? = definedExternally): Promise<JSZip>
fun loadAsync(data: Uint8Array<*>, options: JSZipLoadOptions? = definedExternally): Promise<JSZip>
fun loadAsync(data: Blob, options: JSZipLoadOptions? = definedExternally): Promise<JSZip>

fun loadAsync(data: String, options: JSZipLoadOptions? = definedExternally): Promise<JSZip>

Deserialize zip file asynchronously

Link copied to clipboard
fun remove(path: String): JSZip

Removes the file or folder from the archive