Thanks to visit codestin.com
Credit goes to github.com

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