protobuf.js
a pure javascript protocol buffer encoding implementation, written specifically for riak
Last updated 12 years ago by nlf .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install protobuf.js 
SYNC missed versions from official npm registry.

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);
});

Current Tags

  • 1.1.2                                ...           latest (12 years ago)

26 Versions

  • 1.1.2                                ...           12 years ago
  • 1.1.1                                ...           12 years ago
  • 1.1.0                                ...           12 years ago
  • 1.0.1                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
  • 0.0.21                                ...           12 years ago
  • 0.0.20                                ...           12 years ago
  • 0.0.19                                ...           12 years ago
  • 0.0.18                                ...           12 years ago
  • 0.0.17                                ...           13 years ago
  • 0.0.16                                ...           13 years ago
  • 0.0.15                                ...           13 years ago
  • 0.0.14                                ...           13 years ago
  • 0.0.13                                ...           13 years ago
  • 0.0.12                                ...           13 years ago
  • 0.0.11                                ...           13 years ago
  • 0.0.10                                ...           13 years ago
  • 0.0.9                                ...           13 years ago
  • 0.0.8                                ...           13 years ago
  • 0.0.7                                ...           13 years ago
  • 0.0.6                                ...           13 years ago
  • 0.0.5                                ...           13 years ago
  • 0.0.4                                ...           13 years ago
  • 0.0.3                                ...           13 years ago
  • 0.0.2                                ...           13 years ago
  • 0.0.1                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 12
Last Month 13
Dependencies (1)
Dev Dependencies (3)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |