man!! i am trying to do that same currently looking into node.js npm modules called rpi-gpio @
https://npmjs.org/package/rpi-gpio but had problem figuring out what is the p1 header, p2header is all about. And when you say pin 7 on rpi-gpio does that means pin 7 on the pi as well. totally confuseddd