Description
The module must be imported with
import * as WebSocket from 'ws';
while the readme shows the module being imported with
import WebSocket, { WebSocketServer } from 'ws';
Reproducible in:
Any TypeScript project.
Steps to reproduce:
-
install ws
-
import it like import WebSocket, { WebSocketServer } from 'ws'; in a project
-
try using the module as expected
Expected result:
The module can be imported as shown in the readme.
Actual result:
The module must be imported in alternative ways.
Attachments:
Just try running this piece of code
import WebSocket, { WebSocketServer } from 'ws';
const WSServer = new WebSocketServer();