Skip to content

Commit abb7e5b

Browse files
authored
Merge pull request #18 from iceddev/esbuild
es modules for browser and node
2 parents f64c363 + 8a75cf6 commit abb7e5b

File tree

17 files changed

+801
-881
lines changed

17 files changed

+801
-881
lines changed

.github/workflows/workflow.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ jobs:
44
test:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v1
8-
with:
9-
fetch-depth: 1
7+
- uses: actions/checkout@v4
108
- name: Setup Node.js
11-
uses: actions/setup-node@v1
9+
uses: actions/setup-node@v4
1210
with:
13-
node-version: 14.15.1
11+
node-version: 22
1412
- name: Installing dependencies
1513
run: npm install
1614
- name: Running tests

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,21 @@ socket.onopen = (event) => {
7272

7373
The websocket server could even make *arbitrary calls to the client!*
7474

75-
#### on the server:
75+
#### on the server (using [ws](https://github.com/websockets/ws)):
7676
```javascript
77+
import rawr, { transports } from 'rawr';
78+
7779
socketServer.on('connection', (socket) => {
78-
const peer = rawr({
79-
transport: transports.websocket(socket)
80+
const peer = rawr({
81+
transport: transports.websocket(socket)
8082
});
8183

8284
const result = await peer.methods.doSomethingOnClient();
8385
});
8486
```
8587

88+
The websocket transport works with both browser WebSocket and Node.js [ws](https://github.com/websockets/ws) library.
89+
8690
## Handling Notifications
8791

8892
Peers can also send each other [notifications](https://www.jsonrpc.org/specification#notification):

0 commit comments

Comments
 (0)