Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 590 Bytes

README.md

File metadata and controls

29 lines (20 loc) · 590 Bytes

csgo-protobuf

CS2 protobuf messages for JavaScript.

Installation

npm install csgo-protobuf

Example

import fs from "fs";
import { fromBinary, CDataGCCStrike15_v2_MatchInfo } from "csgo-protobuf";

// Read a CDataGCCStrike15_v2_MatchInfo protobuf message from a CS2 ".info" file.
fs.readFile("./sample.info", (error, bytes) => {
  if (error) {
    console.error(error);
    return;
  }

  const matchInfo = fromBinary(CDataGCCStrike15_v2_MatchInfo, bytes);
  console.log(matchInfo);
});

License

MIT