Skip to Content
defold-typescript libraries
indiesoftby

indiesoftby/defold-zstd/zstd

The Zstandard Compression Library for Defold

  • GitHub: indiesoftby/defold-zstd — pinned to 1.5.7-3 (released while Defold 1.11.1 was current)
    1. Pick a release from indiesoftby/defold-zstd releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as zstd from "zstd"
  • Asset Portal: defold-zstd

Functions

zstd.version(): string

Returns the version of the Zstandard library

Returns

  • version: string

zstd.compress(data: string, level?: number): string

Compresses a string.

Parameters

  • data: string — The data to compress
  • level?: number — Optional compression level (default is 3, maximum is 22)

Returns

  • compressed_data: string — The compressed data

zstd.decompress(data: string): string

Decompresses a string.

Parameters

  • data: string — The data to decompress

Returns

  • decompressed_data: string — The decompressed data

On this page