Raspberry Pi + Node.js: flashing LED

This was my first attempt at doing anything with hardware. I thought it might be fun to get Node.js working on my Raspberry Pi and do the hello world of electronics: making an LED flash on the push of a button.

Once I got Node installed, I looked at a few Node.js GPIO libraries and settled on GPIO Stream by Adafruit. From that point, it was about 4 lines of code, similar to the example in their docs:

var GpioStream = require('gpio-stream'),
    button = GpioStream.readable(17),
    led = GpioStream.writable(18);

button.pipe(led);

Here's the result:

alt text