Skip to content

Commit bf0999e

Browse files
committed
Add generated code docs as docs/index.md
1 parent 1c001d3 commit bf0999e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ the output files are computed by taking the `library` value or message name
2727
So, for example, let's say you invoke the compiler as follows:
2828

2929
```
30-
protoc --proto_path=src --js_out=library=whizz/ponycopter,binary:build/gen src/foo.proto src/bar/baz.proto
30+
protoc --plugin=protoc-gen-js=/path/to/protobuf-javascript/bazel-bin/generator/protoc-gen-js --proto_path=src --js_out=library=whizz/ponycopter,binary:build/gen src/foo.proto src/bar/baz.proto
3131
```
3232

3333
The compiler will read the files `src/foo.proto` and `src/bar/baz.proto` and
@@ -45,7 +45,7 @@ You should be able to import your generated types with statements like:
4545

4646
```js
4747
goog.require('proto.my.package.MyMessage');
48-
var message = proto.my.package.MyMessage();
48+
const message = proto.my.package.MyMessage();
4949
```
5050

5151
### CommonJS Imports
@@ -59,7 +59,7 @@ names of the output files are computed by taking the name of the each input
5959
So, for example, let's say you invoke the compiler as follows:
6060

6161
```
62-
protoc --proto_path=src --js_out=import_style=commonjs,binary:build/gen src/foo.proto src/bar/baz.proto
62+
protoc --plugin=protoc-gen-js=/path/to/protobuf-javascript/bazel-bin/generator/protoc-gen-js --proto_path=src --js_out=import_style=commonjs,binary:build/gen src/foo.proto src/bar/baz.proto
6363
```
6464

6565
The compiler will read the files `src/foo.proto` and `src/bar/baz.proto` and
@@ -80,8 +80,8 @@ PROTOC=/path/to/protoc PROTOC_INC=/path/to/proto/include gulp dist
8080
You should be able to import your generated types with statements like:
8181

8282
```js
83-
var messages = require('./messages_pb');
84-
var message = new messages.MyMessage();
83+
const messages = require('./messages_pb');
84+
const message = new messages.MyMessage();
8585
```
8686

8787
### Compiler Options

0 commit comments

Comments
 (0)