webpeerjs 0.0.3 → 0.0.5
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 +11 -2
- package/dist/esm/webpeerjs.js +333 -43035
- package/dist/umd/webpeerjs.js +16352 -13273
- package/package.json +3 -6
- package/src/config.js +4 -254
- package/src/peer.js +64 -0
- package/src/utils.js +15 -9
- package/src/webpeerjs.js +85 -31
- package/src/config.d.ts +0 -22
- package/src/package.json +0 -1
- package/src/utils.d.ts +0 -8
- /package/{src → dist/esm}/webpeerjs.d.ts +0 -0
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
WebpeerJS enables browser to browser connectivity without a central server.
|
|
5
5
|
|
|
6
|
+
[Demo](https://nuzulul.github.io/webpeerjs/demo/)
|
|
7
|
+
|
|
6
8
|
## Example
|
|
7
9
|
|
|
8
10
|
```
|
|
@@ -16,14 +18,13 @@ void async function main() {
|
|
|
16
18
|
|
|
17
19
|
const [send,listen,members] = node.joinRoom('myroom')
|
|
18
20
|
|
|
19
|
-
send('hello')
|
|
20
|
-
|
|
21
21
|
listen((message,id) => {
|
|
22
22
|
console.log(`Message from ${id} : ${message}`)
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
members((data) => {
|
|
26
26
|
console.log(`Members : ${data}`)
|
|
27
|
+
send('hello')
|
|
27
28
|
})
|
|
28
29
|
|
|
29
30
|
}()
|
|
@@ -31,10 +32,18 @@ void async function main() {
|
|
|
31
32
|
|
|
32
33
|
## Install
|
|
33
34
|
|
|
35
|
+
NPM :
|
|
36
|
+
|
|
34
37
|
```
|
|
35
38
|
npm i webpeerjs
|
|
36
39
|
```
|
|
37
40
|
|
|
41
|
+
CDN :
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
<script src="https://cdn.jsdelivr.net/npm/webpeerjs@0.0/dist/umd/webpeerjs.min.js"></script>
|
|
45
|
+
```
|
|
46
|
+
|
|
38
47
|
## API
|
|
39
48
|
|
|
40
49
|
- `createWebpeer()` Create a new local node.
|