loadTaffy()
function loadTaffy(): Promise<InitOutput>;
Universal initialization function for Taffy WASM module.
Automatically detects the environment (Web or Node.js) and loads the WASM accordingly.
- In a Web environment, it uses
fetchto load the WASM file. - In a Node.js environment, it uses
fsto read the WASM file.
Returns
Promise<InitOutput>
- A promise that resolves to the WASM module exports.
Example
import { loadTaffy } from "taffy-layout"; await loadTaffy();