@racehub-io/f1game-udp-parser
TypeScript icon, indicating that this package has built-in type declarations

0.4.12 • Public • Published

F1 Game UDP Parser

npm (scoped) GitHub

Installing

Important!

This is a native node module written in Rust. To allow for cross compatibility it builds from source on installation. You will require Rust installed, before installing this module. As soon as Neon is stable enough to compile through node-gyp for compiled releases we will migrate.

$ npm install @racehub-io/f1game-udp-parser

or

$ yarn add @racehub-io/f1game-udp-parser

Usage

import { TelemetryClient, constants } from "@racehub-io/f1game-udp-parser";
// or: const { TelemetryClient, constants } = require('f1game-udp-parser');
const { DATA } = constants;

const client = new TelemetryClient({port: 20777, forwardAddresses: [{port:30500}]});
client.on(DATA, (packetVersion, packetType, packetData) => console.log(packetData));

client.start();

// and when you want to stop:
client.stop();

ToDo

  • [ ] Migrate publishing to node-gyp for compiled builds
  • [ ] Move UDP socket and EventEmitter to Rust
  • [ ] Improve packet dependent logic inside Rust parser
  • [ ] Migrate to N-API backend with Neon
  • [ ] Update Rust dependencies

/@racehub-io/f1game-udp-parser/

    Package Sidebar

    Install

    npm i @racehub-io/f1game-udp-parser

    Weekly Downloads

    12

    Version

    0.4.12

    License

    MIT

    Unpacked Size

    358 kB

    Total Files

    309

    Last publish

    Collaborators

    • jonybur
    • msansoni