How to write websocket output to a text file? : I would like to write the output of a javascript websocket continously to a local textfile. How can I do this?

Writing to files seem impossible for javascript (security reasons). That's why I am searching for another solution. This doesnt need to be a browser based solution. Windows cmd is good, too! 

Thank you :)