I very recently accompished this with node-serialport.
The following link explains a good strategy for full control over the Arduino.
Edit: someone edited and added a link for me :)
Check out arduino/serial.ino, pi/server.js and pi/views/profile.ejs. Server.js opens the serialPort and a socket with profile.ejs. When something happens on the profile.ejs it triggers serialPort.write( buffer, encoding ) in server.js;
Just an FYI by default the Arduino Uno resets when a serial connection is opened. If you try and send data without waiting a second or two after the serial connection is opened, it will fail. I found that this problem resolved itself when I required human interaction to trigger serialport.write(). Another solution can be found by googling DisablingAutoResetOnSerialConnection.
Edit: someone edited and added a link for me :)
Check out server.js and /views/profile.ejs. Hope this helps!
@bobbyg603