itty-sockets 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
[](https://github.com/kwhitley/itty-sockets/issues)
|
|
15
15
|
[](https://discord.gg/53vyrZAu9u)
|
|
16
16
|
|
|
17
|
-
### [Full Documentation](https://
|
|
17
|
+
### [Full Documentation](https://ittysockets.com/docs) | [Discord](https://discord.gg/53vyrZAu9u)
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
@@ -22,7 +22,15 @@
|
|
|
22
22
|
|
|
23
23
|
No accounts, no API keys, nothing to deploy. Just connect and start sending.
|
|
24
24
|
|
|
25
|
-
**~466 bytes**
|
|
25
|
+
### **~466 bytes** • **free forever**
|
|
26
|
+
|
|
27
|
+
<br />
|
|
28
|
+
|
|
29
|
+
> After building realtime apps for years, I wanted something absolutely frictionless for prototyping. Spinning up socket servers or authenticating to services like Pusher/Ably involves overhead every time... so I built a service for myself (and everyone else). Then I designed this super-tiny WebSocket client that made even *that* side really easy to work with.
|
|
30
|
+
>
|
|
31
|
+
> Welcome to `itty-sockets`!
|
|
32
|
+
|
|
33
|
+
<br />
|
|
26
34
|
|
|
27
35
|
## Features
|
|
28
36
|
- **Zero Configuration** - No accounts, no API keys, no server. Pick a channel name and you're live.
|
|
@@ -33,6 +41,8 @@ No accounts, no API keys, nothing to deploy. Just connect and start sending.
|
|
|
33
41
|
- **Use Anywhere** - No vendor lock. This client works with *any* WebSocket server. Want to host your own? No problem.
|
|
34
42
|
- **Tiny Client** - Only 466 bytes gzipped.
|
|
35
43
|
|
|
44
|
+
<br />
|
|
45
|
+
|
|
36
46
|
## Quick Start
|
|
37
47
|
```ts
|
|
38
48
|
import { connect } from 'itty-sockets' // ~466 bytes
|
|
@@ -44,6 +54,8 @@ connect('my-channel')
|
|
|
44
54
|
.send({ foo: 'bar' }) // objects
|
|
45
55
|
```
|
|
46
56
|
|
|
57
|
+
<br />
|
|
58
|
+
|
|
47
59
|
## Chat Example
|
|
48
60
|
```ts
|
|
49
61
|
import { connect } from 'itty-sockets'
|
|
@@ -60,6 +72,8 @@ bob.send('hey Alice!')
|
|
|
60
72
|
// → "Bob: hey Alice!"
|
|
61
73
|
```
|
|
62
74
|
|
|
75
|
+
<br />
|
|
76
|
+
|
|
63
77
|
## API at a Glance
|
|
64
78
|
|
|
65
79
|
| Method | Description |
|
|
@@ -73,4 +87,6 @@ bob.send('hey Alice!')
|
|
|
73
87
|
| `.close()` | Disconnect |
|
|
74
88
|
| `.remove(type, listener)` | Remove a listener |
|
|
75
89
|
|
|
76
|
-
|
|
90
|
+
<br />
|
|
91
|
+
|
|
92
|
+
## See the [full documentation](https://ittysockets.com/docs).
|