mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
- with `{ "type": "commonjs" }` in the package.json file
```js
const io = require("socket.io-client");
const socket = io("/");
```
- with `{ "type": "module" }`
```js
import io from "socket.io-client";
const socket = io("/");
// or
import { Manager } from "socket.io-client";
const manager = new Manager();
const socket = manager.socket("/");
```
Related: https://nodejs.org/api/packages.html#packages_dual_commonjs_es_module_packages
5 lines
90 B
JavaScript
5 lines
90 B
JavaScript
import io from "./build/index.js";
|
|
|
|
export const Manager = io.Manager;
|
|
export default io;
|