Skip to content

ws-asyncapi/client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

client

npm npm downloads

Installation

npm install @ws-asyncapi/client

Usage

Designed to work with @ws-asyncapi/cli

npx @ws-asyncapi/cli http://localhost:3005/asyncapi.json
import { websocketAsyncAPI } from "@ws-asyncapi/client";

const client = websocketAsyncAPI("ws://localhost:3005/test");

client.onEvent("response", (data) => {
    console.log(data.name);
});

client.onClose((data) => {
    console.log(data);
});

client.onOpen(() => {
    console.log("connected");
});

await client.opened;

client.call("test", {
    name: "test",
});

About

Client for async api generated types

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors