@moq/watch 0.2.5 → 0.2.6
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 +27 -0
- package/{broadcast-CZkbruBC.js → broadcast-BdsV4u8m.js} +322 -325
- package/{broadcast-CZkbruBC.js.map → broadcast-BdsV4u8m.js.map} +1 -1
- package/element.d.ts +1 -2
- package/element.d.ts.map +1 -1
- package/element.js +9 -11
- package/element.js.map +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/sync.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,33 @@ bun add @moq/watch
|
|
|
17
17
|
npm add @moq/watch
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
### No-build CDN usage
|
|
21
|
+
|
|
22
|
+
For quick demos or embeds where a bundler is overkill, jsDelivr's `+esm`
|
|
23
|
+
endpoint will transform the published npm package into a browser-ready ESM
|
|
24
|
+
module — bare imports like `@moq/hang` are automatically rewritten to
|
|
25
|
+
other `+esm` URLs. No build step or import map required:
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<script type="module">
|
|
29
|
+
import "https://cdn.jsdelivr.net/npm/@moq/watch/element.js/+esm";
|
|
30
|
+
import "https://cdn.jsdelivr.net/npm/@moq/watch/ui/index.js/+esm";
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<moq-watch-ui>
|
|
34
|
+
<moq-watch url="https://relay.example.com/anon" name="room/alice">
|
|
35
|
+
<canvas></canvas>
|
|
36
|
+
</moq-watch>
|
|
37
|
+
</moq-watch-ui>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Pin a version range in the URL for production — e.g.
|
|
41
|
+
`https://cdn.jsdelivr.net/npm/@moq/watch@0.2/element.js/+esm`. esm.sh
|
|
42
|
+
(`https://esm.sh/@moq/watch/element`) works the same way if you prefer it.
|
|
43
|
+
|
|
44
|
+
For anything beyond embedding on a static page you should install the
|
|
45
|
+
package and use a real bundler (the examples below).
|
|
46
|
+
|
|
20
47
|
## Web Component
|
|
21
48
|
|
|
22
49
|
The simplest way to watch a stream:
|