A JavaScript port of boxcars using WebAssembly
boxcars.js is a JavaScript port of the Rocket League replay parser library boxcars by nickbabcok. It uses WebAssembly to compile the underlying Rust implementation to a wasm module for JavaScript. It provides typing for all object, even the parsed replay.
- β¨ Fully Typed: Full TypeScript support built in
- π οΈ Intuitive API: Designed for developer productivity and ease of use.
- β‘ Lightweight and Fast: Zero Dependencies & Rust execution speed
Install the latest version using:
npm install boxcars.js
yarn add boxcars.js
pnpm add boxcars.js
bun add boxcars.js
Below is an example for parsing a rocket replay file:
import {BoxcarsParser, CrcCheck, NetworkParse} from "boxcars.js";
import * as fs from "node:fs";
const parser = new BoxcarsParser(fs.readFileSync("./test.replay"))
.setCrcCheck(CrcCheck.ALWAYS)
.setNetworkParse(NetworkParse.ALWAYS)
console.log(parser.parse())
For parse options and typing of the parsed replay see boxcars
Currently boxcars.js only targets node.js. A browser build is planned for the future. Let me know if there is demand for this.
wasm-pack build -t nodejs
wasm-pack pack