Skip to content

Commit 4397607

Browse files
committed
Docs: Slightly shortened README
1 parent e64cf65 commit 4397607

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

README.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@
55

66
**protobuf.js** is a pure JavaScript implementation with TypeScript support for node and the browser. It's super easy to use, blazingly fast and works out of the box on .proto files!
77

8-
**Recommended read:** [Changes in protobuf.js 6.0](https://github.com/dcodeIO/protobuf.js/wiki/Changes-in-protobuf.js-6.0)
9-
10-
Features
11-
--------
12-
* Optimized [for performance](#performance)
13-
* Excellent [browser support](#compatibility)
14-
* Managed [TypeScript definitions](#usage-with-typescript)
15-
* Elaborate [API documentation](#documentation)
16-
* Convenient [CLI utilities](#command-line)
17-
* Seamless [browserify integration](#browserify-integration)
18-
198
Contents
209
--------
2110

@@ -87,7 +76,7 @@ There is a suitable distribution for each of these:
8776
|---------|---------|------------------------------|---------------------------------|-------------
8877
| full | 18.5kb | [dist][dist-full] | `require("protobufjs")` | All features. Works with everything.
8978
| light | 15.5kb | [dist/light][dist-light] | `require("protobufjs/light")` | All features except tokenizer, parser and bundled common types. Works with JSON definitions, pure reflection and static code.
90-
| minimal | 6.0kb+ | [dist/minimal][dist-minimal] | `require("protobufjs/minimal")` | Just enough to run static code - and nothing else.
79+
| minimal | 6.0kb+ | [dist/minimal][dist-minimal] | `require("protobufjs/minimal")` | Just enough to run static code. No reflection.
9180

9281
In case of doubt you can just use the full library.
9382

@@ -96,7 +85,7 @@ Examples
9685

9786
### Using .proto files
9887

99-
It's possible to load existing .proto files using the full library, which parses and compiles the definitions to ready to use runtime message classes:
88+
It's possible to load existing .proto files using the full library, which parses and compiles the definitions to ready to use reflection-based runtime message classes:
10089

10190
```protobuf
10291
// awesome.proto
@@ -237,7 +226,7 @@ AwesomeMessage.prototype.customInstanceMethod = function() { ... };
237226

238227
### Using services
239228

240-
The library also supports services but it doesn't make any assumptions about the actual transport channel. Instead, a user must provide a suitable RPC implementation, which is an asynchronous function that takes the reflected service method, the binary HelloRequest and a node-style callback as its parameters:
229+
The library also supports services but it doesn't make any assumptions about the actual transport channel. Instead, a user must provide a suitable RPC implementation, which is an asynchronous function that takes the reflected service method, the binary request and a node-style callback as its parameters:
241230

242231
```js
243232
function rpcImpl(method, requestData, callback) {
@@ -270,14 +259,14 @@ message HelloReply {
270259
```js
271260
...
272261
var Greeter = root.lookup("Greeter");
273-
var greeter = Greeter.create(/* see below */ rpcImpl, /* request delimited? */ false, /* response delimited? */ false);
262+
var greeter = Greeter.create(/* see above */ rpcImpl, /* request delimited? */ false, /* response delimited? */ false);
274263

275264
greeter.sayHello({ name: 'you' }, function(err, response) {
276265
console.log('Greeting:', response.message);
277266
});
278267
```
279268

280-
Services can also be used with promises instead of node-style callbacks:
269+
Services also support promises:
281270

282271
```js
283272
greeter.sayHello({ name: 'you' })
@@ -466,9 +455,9 @@ $> pbjs -t static-module file1.proto file2.proto | pbts -o bundle.d.ts -
466455

467456
### On reflection vs. static code
468457

469-
While using .proto files directly requires the [full library][dist-full] (about 18.5kb gzipped) respectively pure reflection/JSON the [light library][dist-light] (about 15.5kb gzipped), pretty much all code but the relatively short descriptors is shared.
458+
While using .proto files directly requires the [full library][dist-full] respectively pure reflection/JSON the [light library][dist-light], pretty much all code but the relatively short descriptors is shared.
470459

471-
Static code, on the other hand, requires just the [minimal library][dist-minimal] (about 6kb gzipped), but generates additional, albeit editable, source code without any reflection features.
460+
Static code, on the other hand, requires just the [minimal library][dist-minimal], but generates additional, albeit editable, source code without any reflection features.
472461

473462
There is no significant difference performance-wise as the code generated statically is pretty much the same as generated at runtime and both are largely interchangeable as seen in the previous section.
474463

0 commit comments

Comments
 (0)