Then to run it type:
root@clanton:~# node test.js
I need to display the data received from the serial port [Rx (Digital pin 0) and Tx (Digital pin 0) pins on galileo gen 2 ]on web page [for this I am already running lighttpd web server, which is included in the yocto image itself].
So that i can directly read the data from the serial port and display it on web page.
any kind of help will be good for my project.