ooz-wasm
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

ooz-wasm

WASM bindings for ooz: Open source Kraken, Mermaid, Selkie, Leviathan, LZNA, Bitknit decompressor.

Notes

  • .wasm file is base64 embedded using -s SINGLE_FILE=1.
  • WebAssembly Module is compiled when the ESM module is imported using a top-level await.

Requires browser WebAssembly SIMD support.

  • Can be enabled in Chromium-based browsers on about://flags/#enable-webassembly-simd
  • Can be enabled in Firefox on about:config javascript.options.wasm_simd

Usage

// Decompress data
// NOTE: returned TypedArray lives in WASM memory, you can safely use it until the next call to decompressUnsafe/decompress.
function decompressUnsafe(data: Uint8Array, rawSize: number): Uint8Array;

// Decompress data
function decompress(data: Uint8Array, rawSize: number): Uint8Array;

Build

  1. Install Emscripten SDK
  2. emcmake cmake -B build [-G "..."]
  3. Build
    # Ninja (-G "Ninja")
    cmake --build build
    # or Makefiles (-G "Unix Makefiles")
    emmake make -C build

Package Sidebar

Install

npm i ooz-wasm

Weekly Downloads

59

Version

2.0.0

License

GPL-3.0-or-later

Unpacked Size

170 kB

Total Files

6

Last publish

Collaborators

  • snosme