Skip to content

Kinqdos/boxcars.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

boxcars.js

A JavaScript port of boxcars using WebAssembly

About

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.

πŸš€ Features

  • ✨ 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

πŸ“₯ Installation

Install the latest version using:

npm install boxcars.js
yarn add boxcars.js
pnpm add boxcars.js
bun add boxcars.js

πŸ“ Usage

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

βš™οΈ Limitations

Currently boxcars.js only targets node.js. A browser build is planned for the future. Let me know if there is demand for this.

πŸ›  Build

πŸ›  Compile rust to wasm with wasm-pack build

wasm-pack build -t nodejs

πŸ“¦ Build npm package

wasm-pack pack

About

JavaScript port of boxcars

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages