Package Exports
- csgo-protobuf
- csgo-protobuf/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (csgo-protobuf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
csgo-protobuf
CS2 protobuf messages for JavaScript.
Installation
npm install csgo-protobuf
Example
import fs from "node:fs";
import { fromBinary, CDataGCCStrike15_v2_MatchInfoSchema } 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_MatchInfoSchema, bytes);
console.log(matchInfo);
});