aoe2rec-js

Crates.ioaoe2rec-js
lib.rsaoe2rec-js
version0.1.13
created_at2025-02-05 22:01:49.270105+00
updated_at2025-08-15 14:09:42.169385+00
descriptionWASM version of aoe2rec to parse Age of Empires II: Definitive Edition recorded games in the browser
homepage
repository
max_upload_size
id1544773
size40,928
Stéphane Bisinger (Kjir)

documentation

README

Age of Empires 2 Record parser

This is a WASM library to parse Age of Empires 2 DE save games

Usage

To use the library, pass a ArrayBuffer to the parse_rec function. Example:

<input type="file" id="fileElem">
import { parse_rec } from "aoe2rec-js";

const fileElem = document.getElementById("fileElem");
fileElem.addEventListener("change", event => {
  const files = (event.target as HTMLInputElement).files
  if (!files) {
    replayFile.value = null
    return
  }
  const file = files[0]
  const reader = new FileReader();
  reader.addEventListener('loadend', (event) => {
    try {
      const rec = parse_rec(event.target.result);
    } catch (error) {
      // It's important to catch errors because not all recs are guaranteed to parse correctly
      console.error("Failed to parse game");
    };
  }, false);
  reader.readAsArrayBuffer(file);

}, false);
Commit count: 0

cargo fmt