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

  • 0.0.21
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37K
decreased by-22.25%
Maintainers
1
Weekly downloads
 
Created
Source

Protobuf.js

This is an extremely lightweight, stripped down, ugly implementation of protocol buffers written specifically for use in making a Riak library. As such, it lacks support for many of the data types, and handles a few Riak specific fields in special ways (vclocks, for one). I will happily accept pull requests to make it more compatible with the full spec.

What it does:

  • parses .proto files to build a schema (including imports) in a very very rough way
  • encodes objects to buffers
  • decodes buffers to objects
  • supports the string/bytes and varint types

What it does not do:

  • have full support for every directive in .proto files
  • have support for any types other than varint or string/bytes
  • make your breakfast

Usage

var protobuf = require('protobuf.js'),
    translator = protobuf.loadSchema('./riak_kv.proto');

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

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

Keywords

FAQs

Package last updated on 02 Jan 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