json-protobuf-encoding

1.0.1 • Public • Published

json-protobuf-encoding

JSON encoding for protobuf

npm install json-protobuf-encoding

Usage

Given a schema

message Test {
  required json misc;
}
var fs = require('fs')
var protobuf = require('protocol-buffers')
var json = require('json-protobuf-encoding')

var messages = protobuf(fs.readFileSync('schema.proto'), {
  encodings: {
    json: json()
  }
})

var data = messages.Test.encode({misc:{hello:'world'}})

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i json-protobuf-encoding

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mafintosh