Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information