Creating the ws-client Module
The ws-client.js module will handle communicating with your Node WebSocket server.
It will have four responsibilities:
connecting to the server
performing initial setup when the connection is first opened
forwarding incoming messages to their handlers
sending outgoing messages
Check out how those responsibilities relate to your other components (Figure 17.14).
As you build out your client, you will get a tour of some new ES6 features as well.
First, build out your collection handling. Begin by opening ws-client.js ...