Skip to content

Commit d31dc5e

Browse files
authored
chore: update readme
1 parent f7ba098 commit d31dc5e

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

README.md

+31-28
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,31 @@
1111

1212
> TypeScript implementation of the [Cap'n Proto](https://capnproto.org) serialization protocol.
1313
14-
Cap’n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think [Protocol Buffers](https://github.com/protocolbuffers/protobuf), except faster. In fact, in benchmarks, Cap’n Proto is INFINITY TIMES faster than Protocol Buffers, because there is no encoding/decoding step. Start with the [Cap'n Proto Introduction](https://capnproto.org/index.html) for more detailed information on what this is about.
15-
16-
## Status
17-
1814
> [!WARNING]
19-
> WARNING: THIS IS ALPHA QUALITY SOFTWARE. USE AT YOUR OWN RISK. AUTHORS ARE NOT RESPONSIBLE FOR LOSS OF LIMB, LIFE, SANITY, OR RETIREMENT FUNDS DUE TO THE USE OF THIS SOFTWARE. Feedback and contributions are welcome.
20-
21-
This project is a rework<sup>1</sup> of [jdiaz5513/capnp-ts](https://github.com/jdiaz5513/capnp-ts/) by Julián Díaz and under development (honestly more a playground at this stage). Until version `1.x.x` lands, the API can change from `0.x` to `0.y`.
15+
> This is an alpha-quality software. please use at your own risk ([project status](#status)).
2216
23-
- Serialization: working, may be missing features
24-
- Schema Compiler: working, may be missing features
25-
- RPC: not implemented yet
17+
Cap’n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think [Protocol Buffers](https://github.com/protocolbuffers/protobuf), except faster. Cap’n Proto was built by [Kenton Varda](https://github.com/kentonv) to be used in [Sandstorm](https://capnproto.org/faq.html#sandstorm) and is now heavily used in [Cloudflare](https://capnproto.org/faq.html#cloudflare). Start with the [Cap'n Proto Introduction](https://capnproto.org/index.html) for more detailed information on what this is about.
2618

27-
**<sup>1</sup> Changes from `capnp-ts`:**
28-
29-
- [x] Internal refactors and simplifications as was playing around.
30-
- [x] Compiler, runtime, and std lib published via a single and compact ESM-only package with subpath exports.
31-
- [x] Compiler updated to use Typescript v5 API
32-
- [x] Output files can be `.ts` (new), `.js` (ESM instead of CJS), and `.d.ts` and has no `.capnp` suffix.
33-
- [x] Compiler API can be used via the `capnp-es/compiler` subpath export programmatically.
34-
- [x] Use native `TextEncoder` and `TextDecoder` for utf8 encoding
35-
- [x] Enums are typed plain JS objects (this way `.ts` files work with strip-only ts loaders without enum support.)
36-
- [x] Compiler CLI can directly accept path to `.capnp` files and internally use `capnpc`
37-
- [ ] (WIP) Use reflection (getter setters) to access structs.
38-
- [ ] (TODO) Investigate performannce. Seems some language features (specially on older Node.js) make full traverse slow.
39-
- [ ] (planned) Investigate RPC level 1 (some progress [here](https://github.com/jdiaz5513/capnp-ts/pull/169))
40-
- [ ] (planned) Investigate possibility of bundling wasm version of `capnp`
4119

4220
## Usage
4321

44-
> [!NOTE]
45-
> Make sure `capnpc` command is available. You can find install instructions [here](https://capnproto.org/capnp-tool.html) to install it.
22+
Make sure `capnpc` command is available. You can find install instructions [here](https://capnproto.org/install.html) to install it.
4623

4724
Run the following to compile a schema file into typeScript/javascript source code:
4825

4926
```shell
5027
npx capnp-es --ts --dts --js path/to/myschema.capnp
51-
# or pipe
28+
```
29+
or
30+
```shell
5231
capnpc -o- path/to/myschema.capnp | npx capnp-es --ts --dts --js
5332
```
5433

5534
This will generate `path/to/myschema.{ts,d.ts,js}` (ESM syntax).
5635

5736
See [playground](./playground/) for examples and learn more about `.capnp` schema in capnp language [docs](https://capnproto.org/language.html).
5837

59-
## Reading Messages
38+
### Reading Messages
6039

6140
Here's a quick usage example:
6241

@@ -68,6 +47,30 @@ const message = capnp.Message.fromArrayBuffer(buffer);
6847
const struct = message.getRoot(MyStruct);
6948
```
7049

50+
## Status
51+
52+
This project is a rework<sup>1</sup> of [jdiaz5513/capnp-ts](https://github.com/jdiaz5513/capnp-ts/) by Julián Díaz and is under development.
53+
54+
- [x] Schema Compiler: working, may be missing features
55+
- [x] Serialization: working, may be missing features
56+
- [ ] RPC: not yet
57+
58+
**<sup>1</sup> Changes from `capnp-ts`:**
59+
60+
- [x] Internal refactors and simplifications as was playing around.
61+
- [x] Compiler, runtime, and std lib published via a single and compact ESM-only package with subpath exports.
62+
- [x] Compiler updated to use Typescript v5 API
63+
- [x] Output files can be `.ts` (new), `.js` (ESM instead of CJS), and `.d.ts` and has no `.capnp` suffix.
64+
- [x] Compiler API can be used via the `capnp-es/compiler` subpath export programmatically.
65+
- [x] Use native `TextEncoder` and `TextDecoder` for utf8 encoding
66+
- [x] Enums are typed plain JS objects (this way `.ts` files work with strip-only ts loaders without enum support.)
67+
- [x] Compiler CLI can directly accept a path to `.capnp` files and internally use `capnpc`
68+
- [ ] [WIP] Use reflection (getter setters) to access structs.
69+
- [ ] [TODO] Investigate runtime performance. Some language features make full traverse slow. (especially on Node 20, Bun is fast and all good)
70+
- [ ] [PLANNED] Investigate RPC level 1 (some progress [here](https://github.com/jdiaz5513/capnp-ts/pull/169))
71+
- [ ] [PLANNED] Investigate the possibility of bundling the wasm version of `capnp`
72+
73+
7174
## Development
7275

7376
<details>

0 commit comments

Comments
 (0)