Skip to content

PenguinMod/pmp-protobuf

Repository files navigation

PMP Protobuf NPM version

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-protobuf

Usage

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

MIT

Dev

Generate Bundle

You install pbjs... somehow... tbh I don't remember... It's been a while.

pbjs -t json --keep-case path/to/protobufs/project.proto path/to/protobufs/sprite.proto > dest/bundle.json

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •