Hi!
It seems to me that you should structure your code such that each command emits a 'message' event; it appears that you have a single routine which runs all of your commands and then emits a single message for all of the output. Impossible for me to say of course, but that's what I get out of what I see from your snippet.
Alternatively, backend() needs to be non-blocking and there's a lot behind the scenes there.
Sorry that's not any help, but I can at least reassure you that what you are driving towards is definitely possible! You can definitely send the result back to the browser via websocket of just one command without waiting for the others to finish.
This sounds like a project I'd be interested in contributing to if you can make your code public. I've worked on similar things in the past, specifically for monitoring Linux boxes.