Skip to content

Commit 4106f1f

Browse files
author
melike2d
committed
📝 add readme!
1 parent ed666e9 commit 4106f1f

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PogSocket
2+
3+
> Deno websocket client (based on the original deno websocket client).
4+
5+
## Usage
6+
7+
**Connecting to Echo Server**
8+
9+
```ts
10+
import { connectPogSocket, readSocket, sendMessage } from "https://deno.land/x/pogsocket/mod.ts";
11+
12+
const socket = await connectPogSocket("ws://localhost:3030");
13+
setInterval(() => sendMessage(socket, "hello me!"), 2000);
14+
15+
for await (const event of readSocket(socket)) {
16+
if (event.type === "message") {
17+
console.log(event.message);
18+
}
19+
}
20+
```
21+
22+
---
23+
24+
[melike2d](https://dimensional.fun)

0 commit comments

Comments
 (0)