Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

proto3-json-serializer

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proto3-json-serializer

Support for proto3 JSON serialiazation/deserialization for protobuf.js

  • 0.1.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.4M
increased by7.02%
Maintainers
1
Weekly downloads
 
Created

What is proto3-json-serializer?

The proto3-json-serializer npm package is designed to facilitate the serialization and deserialization of Protocol Buffers (protobuf) messages to and from JSON format, specifically tailored for Protocol Buffers version 3 (proto3). This package is particularly useful when integrating systems that use protobufs with those that operate with JSON, ensuring data compatibility and ease of data handling between different systems or components.

What are proto3-json-serializer's main functionalities?

Serialization

This feature allows you to serialize a protobuf message into JSON. The code sample demonstrates how to load a protobuf schema, create a message, and serialize it into JSON.

const { serialize } = require('proto3-json-serializer');
const root = protobuf.loadSync('awesome.proto');
const AwesomeMessage = root.lookupType('awesomepackage.AwesomeMessage');
const message = AwesomeMessage.create({ awesomeField: 'Hello, World!' });
const json = serialize(message);
console.log(json);

Deserialization

This feature enables the deserialization of JSON back into a protobuf message. The code sample shows how to take a JSON object and convert it back into a protobuf message using the defined schema.

const { deserialize } = require('proto3-json-serializer');
const root = protobuf.loadSync('awesome.proto');
const AwesomeMessage = root.lookupType('awesomepackage.AwesomeMessage');
const json = { awesomeField: 'Hello, World!' };
const message = deserialize(AwesomeMessage, json);
console.log(message);

Other packages similar to proto3-json-serializer

Keywords

FAQs

Package last updated on 14 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc