1.0.1 • Published 10 years ago

json-protobuf-encoding v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

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

1.0.1

10 years ago

1.0.0

10 years ago