Skip to content

Commit

Permalink
docs: fix README file was not published
Browse files Browse the repository at this point in the history
  • Loading branch information
babiabeo committed Mar 5, 2024
1 parent 191a149 commit 050af55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@

[![Built with the Deno Standard Library](https://raw.githubusercontent.com/denoland/deno_std/main/badge.svg)](https://deno.land/std)

**_Deko_** is a simple WebSocket client for Deno.
**_Deko_** is a simple WebSocket client for Deno.

> [!WARNING]
> If you want to connect WebSocket on browsers, use [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) instead.
> If you want to connect WebSocket on browsers, use
> [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)
> instead.
## Features

- [x] Easy to use.
- [x] Supports custom headers.
- [x] Passes the [Autobahn testsuite](https://github.com/crossbario/autobahn-testsuite). [^report]
- [x] Follows [RFC 6455](https://datatracker.ietf.org/doc/html/rfc6455) WebSocket implementation.
- [x] Passes the
[Autobahn testsuite](https://github.com/crossbario/autobahn-testsuite). [^report]
- [x] Follows [RFC 6455](https://datatracker.ietf.org/doc/html/rfc6455)
WebSocket implementation.

## Usage

Expand Down Expand Up @@ -47,12 +51,11 @@ const client = new Deko({ uri: "websocket url goes here" });

client.onOpen = () => {
console.log("Connected to WebSocket server!");
}
};

await client.connect();
```


#### Receives a text message from WebSocket server

```ts
Expand All @@ -64,7 +67,7 @@ client.onMessage = (_, message) => {
if (message.opcode === OpCode.TextFrame) {
console.log(new TextDecoder().decode(message.payload));
}
}
};

await client.connect();
```
Expand All @@ -87,4 +90,4 @@ setTimeout(async () => {

This repository/package is under **MIT License**. See [LICENSE](./LICENSE).

[^report]: https://babiabeo.github.io/autobahn/deko/
[^report]: https://babiabeo.github.io/autobahn/deko/
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@babia/deko",
"version": "0.1.0",
"version": "0.1.1",
"imports": {
"@std/bytes": "jsr:@std/bytes@^0.218.2",
"@std/encoding": "jsr:@std/encoding@^0.218.2",
"@std/io": "jsr:@std/io@^0.218.2"
},
"exports": "./mod.ts",
"exclude": [".vscode", "autobahn", "README.md", "LICENSE", "docs"],
"exclude": [".vscode", "autobahn", "docs"],
"tasks": {
"autobahn": "deno run --allow-net test/autobahn.ts",
"lint": "deno fmt --check && deno lint",
Expand Down

0 comments on commit 050af55

Please sign in to comment.