I'm building a webchat using node.js and socket.io; when a webuser connects to the chat i create a room for him and i would like to set variables to the room, so that iterating on it i get the values for every single user.
Is there a way to set variables for a room or do i need to use "external" tools like arrays or db?
I created a module just for this purpose: https://www.npmjs.org/package/roomdata
It creates a rooms variable which is just a object holding nothing, When a user joins a room it checks if rooms[roomname] exists. If it does not exists rooms[roomname] will be created and now you can apply variables to it. This module just makes it easier to do this.