Actually I was being unfair. Espruino changed recently so it errors for undefined variables - this would have worked fine previously, but it had some code left over from being copy/pasted from the MCP20S17 that would make it fail now.
If you try now I've changed it and it should work (you may have to shut down the IDE and restart it, as it might cache the modules).
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.
Actually I was being unfair. Espruino changed recently so it errors for undefined variables - this would have worked fine previously, but it had some code left over from being copy/pasted from the MCP20S17 that would make it fail now.
If you try now I've changed it and it should work (you may have to shut down the IDE and restart it, as it might cache the modules).