Go to file
2022-01-03 17:11:53 +00:00
.yarn First Commit 2021-12-31 21:38:26 +00:00
examples Add verification and value stripping 2022-01-02 22:02:47 +00:00
lib Bug fixed and improvements 2022-01-03 17:11:53 +00:00
src Bug fixed and improvements 2022-01-03 17:11:53 +00:00
templates Bug fixed and improvements 2022-01-03 17:11:53 +00:00
.editorconfig First Commit 2021-12-31 21:38:26 +00:00
.gitignore Adding Decorators for comments 2022-01-01 18:47:34 +00:00
.yarnrc.yml First Commit 2021-12-31 21:38:26 +00:00
package.json Bug fixed and improvements 2022-01-03 17:11:53 +00:00
README.md Removing prettier for now. Adding CLI option and making it bundle before release to decrease startup time. 2022-01-01 01:08:05 +00:00
tsconfig.json Removing prettier for now. Adding CLI option and making it bundle before release to decrease startup time. 2022-01-01 01:08:05 +00:00
yarn.lock Fixing bug 2022-01-01 01:25:11 +00:00

JSON-RPC 2.0 Code-Gen

Type/Service definition language and code generator for json-rpc 2.0. Currently generating code for NodeJS, Deno and the Web. Other targets are possible, but not implemented yet.

Name Description
ts-node Typescript for NodeJS
ts-esm Typescript in ESM format for Deno

Usage

Create a definition file like test.jrpc:

enum TestEnum {
  VAL1,
  VAL2,
  VAL10 = 10,
  VAL11,
  VAL12
}

type Test {
  testen: TestEnum;
  someString: string;
  someNumber: number;
  array: string[];
  map: {number, TestEnum};
}

service TestService {
  AddNumbers(v1: number,  v2: number): number;


  notification SendTest(test: Test);
}

Then run the generator like this jrpc compile test.jrpc -o=ts-node:output/.

This will generate the Client and Server code in the specified folder.

//TODO: Make Documentation better