Require (the same instance of) socket.io in multiple modules
问题 I am a bit confused, about how to require and use modules in Node.js. My scenario is the following: I wrote a complete server in one single file, which uses Socket.io for realtime communication. Now the index.js became pretty big, and I want to split the code into several modules to make it more managable. For example I have some functions for serving a Survey to the clients, and getting back their answers. I put all those functions in a seperate module, and require it in the index.js. Works