itty-sockets 0.5.4-next.1 → 0.5.4-next.3

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.
Files changed (2) hide show
  1. package/README.md +11 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -18,9 +18,9 @@
18
18
 
19
19
  ---
20
20
 
21
- ## Type-safe WebSocket routing in 540 bytes
21
+ ## Type-safe WebSocket routing in 512 bytes
22
22
 
23
- ## Features ✨
23
+ ### Features ✨
24
24
  1. **Quality of Life Improvements (over native WebSocket)**
25
25
  - auto JSON handling
26
26
  - top-level payload access (`text` instead of `e.data.text`)
@@ -35,9 +35,16 @@
35
35
  - `.on<Chat>('chat', ({ text }) => console.log(text))`
36
36
  - `.send<Chat>({ type: 'chat', text: 'hello' })`
37
37
  1. **Works with any JSON-based WebSocket server**
38
- 1. **Tiny footprint** - 540 bytes is smaller than most WebSocket boilerplate
38
+ 1. **Tiny footprint** - smaller than virtually any WebSocket boilerplate
39
39
 
40
- ## Basic Example
40
+ ### Optional use with `itty.ws` public server
41
+ - great for testing/prototyping
42
+ - `connect<UseItty>('my-channel')` - connect to a channel and go
43
+ - adds `uid`, `alias`, and `date` to all messages
44
+ - adds `join` and `leave` events to announce user changes
45
+ - allows private messaging (by uid)
46
+
47
+ ### Basic Example
41
48
  ```ts
42
49
  import { connect } from 'itty-sockets'
43
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itty-sockets",
3
- "version": "0.5.4-next.1",
3
+ "version": "0.5.4-next.3",
4
4
  "description": "WebSockets : simplified and minified.",
5
5
  "type": "module",
6
6
  "exports": {