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

protobuf.js

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protobuf.js

a pure javascript protocol buffer encoding implementation, written specifically for riak

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Protobuf.js

This is a pure javascript driver for the protocol buffer encoding protocol. It supports most of the types defined by protocol buffers, including 64 bit integers which are returned as long objects.

What it does:

  • reads output from proto2json as a schema
  • encodes objects to buffers
  • decodes buffers to objects

What it does not do:

  • make your breakfast

Usage

var protobuf = require('protobuf.js');
var proto2json = require('node-proto2json');
proto2json.parse(fs.readFileSync('./riak_kv.proto', 'utf8'), function (err, result) {
    var translator = new protobuf(result);

    //msg will *only* contain the protobuf encoded message, *NOT* the full riak packet
    var msg = translator.encode('RpbGetReq', { bucket: 'test', key: 'test' });

    //again, this will *only* decode the protobuf message. you have to remove the riak header yourself
    var decoded = translator.decode('RpbGetResp', responsePacket);
});

Keywords

FAQs

Package last updated on 25 Mar 2014

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