That will show you how to get the approximate readings (0 is North, -90 is West, 90 is East and 180 is South), so you will be able to use them in the rest of your code. I'd be interested to see it posted, good luck!
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I have just updated a thread where I was asking the same question http://forum.espruino.com/comments/13395796/
That will show you how to get the approximate readings (0 is North, -90 is West, 90 is East and 180 is South), so you will be able to use them in the rest of your code. I'd be interested to see it posted, good luck!