You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both CommonJS and ES6 import are now supported:
- with `{ "type": "commonjs" }` in the package.json file
```js
const io = require("socket.io")(8080);
// or
const { Server } = require("socket.io");
const io = new Server(8080);
```
- with `{ "type": "module" }`
```js
import { Server } from "socket.io";
const io = new Server(8080);
```
Related: https://nodejs.org/api/packages.html#packages_dual_commonjs_es_module_packages
0 commit comments