Skip to content

Commit

Permalink
📝 add readme!
Browse files Browse the repository at this point in the history
  • Loading branch information
melike2d committed Aug 12, 2021
1 parent ed666e9 commit 4106f1f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# PogSocket

> Deno websocket client (based on the original deno websocket client).
## Usage

**Connecting to Echo Server**

```ts
import { connectPogSocket, readSocket, sendMessage } from "https://deno.land/x/pogsocket/mod.ts";

const socket = await connectPogSocket("ws://localhost:3030");
setInterval(() => sendMessage(socket, "hello me!"), 2000);

for await (const event of readSocket(socket)) {
if (event.type === "message") {
console.log(event.message);
}
}
```

---

[melike2d](https://dimensional.fun)

0 comments on commit 4106f1f

Please sign in to comment.