I lost 3 and half hours cause I was using nodemon, as I always do, to reload the code after every change and that was breaking: process.stdin.setRawMode(true);
The code as provided worked on my computer for the first two users but when adding a third user it didn't receive the messages written by the first ones.
When removing an user I call but the user is not really removed.
I haven't really had the chance to make any design choice for this simple task.
The typing indicator is quite crude. If userA is writing and userB receives the typing indicator and userB start typing then indicator and text will be intermixed.