# protobufjs_arkts **Repository Path**: ArkTSCentralRepository/protobufjs_arkts ## Basic Information - **Project Name**: protobufjs_arkts - **Description**: Protocol Buffers for ArkTS - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-08 - **Last Updated**: 2025-09-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # protobufjs_arkts 基于[protobufjs](https://www.npmjs.com/package/protobufjs)原库7.5.3版本进行适配 ## Install ```sh ohpm install protobufjs_arkts ``` ## Description **Protocol Buffers** are a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more, originally designed at Google ([see](https://protobuf.dev/)). **protobuf.js** is a pure JavaScript implementation with [TypeScript](https://www.typescriptlang.org) support for [Node.js](https://nodejs.org) and the browser. It's easy to use, does not sacrifice on performance, has good conformance and works out of the box with [.proto](https://protobuf.dev/programming-guides/proto3/) files! ## Usage ```typescript import { load } from "protobufjs_arkts"; load("awesome.proto", function(err, root) { if (err) throw err; // example code const AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage"); let message = AwesomeMessage.create({ awesomeField: "hello" }); console.log(`message = ${JSON.stringify(message)}`); let buffer = AwesomeMessage.encode(message).finish(); console.log(`buffer = ${Array.prototype.toString.call(buffer)}`); let decoded = AwesomeMessage.decode(buffer); console.log(`decoded = ${JSON.stringify(decoded)}`); }); ```