npm install -g bali182/asyncapi-ws-to-ts
- Generate client code:
asyncapi-ws-to-ts -f async-api-schema.json -t client -n MyApiClient > myApiClient.ts
- Generate server code:
asyncapi-ws-to-ts -f async-api-schema.json -t server -n MyApiServer > myApiServer.ts
- Done ✅
- Open 2 terminals (be inside project folder)
- In terminal 1:
npm run sample-server
. Make sure port 3000 is open. - In terminal 2:
npm run sample-client
. After this you can type messages to the standard input. - Source can be found under the
/examples
folder.