pmp-protobuf
v1.7.7
Published
Interact with the format of PMPs and their protobuf counterpart.
Readme
PMP Protobuf 
PMP Protobuf is a helper library for the PMP (PenguinMod Project) format and its protobuf counterpart, which is used in the PenguinMod backend.
Install
Use NPM:
npm install pmp-protobufUsage
jsonToProtobuf
import { jsonToProtobuf } from "pmp-protobuf';
const json = /* get the project.json from somewhere... */;
// this will be a Uint8Array
const protobuf = jsonToProtobuf(json);protobufToJson
import { protobufToJson } from "pmp-protobuf';
const protobuf = /* get the protobuf from somewhere (probably the API)... */;
// this will be an object
const json = protobufToJson(protobuf);protobufToPMP
import { protobufToPMP } from "pmp-protobuf';
const protobuf = /* get the protobuf from somewhere (probably the API)... */;
const assets = /* get these from somewhere (probably also the API)... */;
// this will be in the PMP format; it will be an ArrayBuffer.
const pmp = await protobufToPMP(protobuf, assets);jsonToPMP
import { jsonToPMP } from "pmp-protobuf';
const json = /* get the json from somewhere (probably the VM)... */;
const assets = /* get these from somewhere (probably also the VM)... */;
// this will be in the PMP format; it will be an ArrayBuffer.
const pmp = await jsonToPMP(protobuf, assets);License
Dev
Generate Bundle
node_modules/.bin/pbjs --keep-case protobufs/project.proto protobufs/sprite.proto > protobuf-bundle.json