I'm using a program (pianobar) that has the option to run a program when certain events happen. I want to get the information from these events into my node.js application so I can send it to clients that are connected over socket.io.
The best idea I've come up with so far is to have a middleware program that takes the input from pianobar and writes it to a file. I can then watch the file using fs.watchFile.
Is there a better/cleaner/more direct way to do this?
Depending upon how much data is involved, the cleanest solution is to follow tjameson's advice and POST the data to your node.js application. That way you can just use standard HTTP in your application and do not need to resort to using a one-off file approach. And you can use standard tools such as cURL to quickly and cleanly write the client program.