You can use socket.io-client, just be sure to enable typing during installation.
https://www.npmjs.com/package/socket.io-client
Installation: npm install --save socket.io-client
and
npm install --save @types/socket.io-client or npm install --save-dev @types/socket.io-client
Note. There's a great tutorial out there that provides recommendations for a MEAN full-stack environment here , if that is interesting.
edit: As already mentioned, WebSocket is an HTML5 standard. This will simply create an easy-to-use interface for socket interface interactions and is applicable to any external environment.
source share