Where to find Protobuf Javascript tutorial?

2,277 views
Skip to first unread message

hce h

unread,
Jul 15, 2017, 11:28:39 PM7/15/17
to Protocol Buffers
Hi,

We are using javascript for web front end development and we are using the protobuf to communicate with backend web applications. Currently we are  using GO to do protobuf communication between the backend application server which runs on C++ and the front end  running on Javascript, but I've just found there is a protobuf interface for Javascript as well, we can actually simplify the process directly to use javascript to fetch the protobuf messages with backend application without GO. Is it a good idea? I have since been investigating the javascript protobuf capability but I could not find javascript progotbuf examples and tutorials, the link https://developers.google.com/protocol-buffers/docs/tutorials shows tutorials for every program language except javascript. Appriciate anyone could point me likes for Javascript prototobuf examples and tutorials.

I have also downloaded protobuf-js-3.3.0.zip, but it looks like it is similar to protobuf-cpp-3.3.0.tar.gz which I built on Linux platform, I guess the protobuf-js-3.3.0.zip is not the binary for javascript, link the C++ I need to build it as well, correct?

Thank you.

Kind regards,

 - j

Feng Xiao

unread,
Jul 17, 2017, 2:00:21 PM7/17/17
to hce h, Protocol Buffers
protobuf-js-3.3.0.zip is the original source code for C++ + Javascript. If you only need the already-built protobuf js package, try npm google-protobuf:

Note that you will need to download protoc binary to do the code generation.
 


Thank you.

Kind regards,

 - j

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscribe@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

hce h

unread,
Jul 19, 2017, 7:31:18 AM7/19/17
to Protocol Buffers, jupit...@gmail.com
Thanks for the response. If I understand it correctly, the js package contains a js directory which is pre-built javascript libraries. I built the C++ package and I can use the C++ package to generate javascript library by running "protoc --js_out=library=myproto_libs,binary:. proto3_test.proto"

I am not going to use the node, then I cannot use the npm either, not quite sure if I could install javascript libraries manually without npm? 

On Tuesday, July 18, 2017 at 4:00:21 AM UTC+10, Feng Xiao wrote:
protobuf-js-3.3.0.zip is the original source code for C++ + Javascript. If you only need the already-built protobuf js package, try npm google-protobuf:

Note that you will need to download protoc binary to do the code generation.
 


Thank you.

Kind regards,

 - j

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages