You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
K35 b5ca061136 Fiying bug 1 week ago
.vscode Adding C# Support. Badly tested currently, but kindof working 3 weeks ago
.yarn First Commit 4 weeks ago
examples Renaming csharp_namespace 2 weeks ago
lib Fiying bug 1 week ago
src Fiying bug 1 week ago
templates Fixing nullable warning 2 weeks ago
.editorconfig First Commit 4 weeks ago
.gitignore Adding C# Support. Badly tested currently, but kindof working 3 weeks ago
.yarnrc.yml First Commit 4 weeks ago
README.md Adding some Readme stuff 3 weeks ago
package.json Fiying bug 1 week ago
tsconfig.json Removing prettier for now. Adding CLI option and making it bundle before release to decrease startup time. 4 weeks ago
yarn.lock Adding C# Support. Badly tested currently, but kindof working 3 weeks ago

README.md

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 {
  @Description("This Function adds two number")
  @Param("v1", "The first Number")
  @Param("v2", "The second Number")
  @Returns("The added values of the two numbers")
  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