@putout/plugin-socket-io
v2.0.0
Published
šPutout plugin helps to migrate to new version of socket.io
Maintainers
Readme
@putout/plugin-socket-io 
The library for web and native user interfaces
(c) socket-io.dev
šPutout plugin helps to migrate to new version of socket.io. Not bundled.
Install
npm i putout @putout/plugin-socket-io-hooks -DAdd .putout.json with:
{
"plugins": ["socket-io"]
}Rules
Config
{
"rules": {
"socket-io/convert-io-listen-to-new-server": "on",
"socket-io/declare": "on"
}
}declare
+import {Server} from 'socket.io';
new Server(server);convert-io-listen-to-new-server
ESM has no listen exported, only Server. So it is better to change it to simplify migration.
Check out in šPutout Editor.
ā Example of incorrect code
io.listen(server);ā Example of correct code
new Server(server);License
MIT
