Skip to content

Commit e5897dd

Browse files
authored
docs: add usage with ES modules (#4195)
1 parent 2071a66 commit e5897dd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Readme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ io.on('connection', client => { ... });
115115
io.listen(3000);
116116
```
117117

118+
### Module syntax
119+
120+
```js
121+
import { Server } from "socket.io";
122+
const io = new Server(server);
123+
io.listen(3000);
124+
```
125+
118126
### In conjunction with Express
119127

120128
Starting with **3.0**, express applications have become request handler

0 commit comments

Comments
 (0)