While I have been searching for different alternatives to
broadcast with socket.io, the solution is quite simple. Use
global variable to access it.
For example in my
Simple solution would be
And access from different file that's been loaded with
require for example
io variable will be simple accessible and able to send from any file you’re in.
Alternative solution for the paranoids
Well that's it.
Alternative Solution: Passing socket.io as argument
Update: 7 Jun 2020