If you want to use SPI I would suggest extending the Espruino SPI class to support slave mode. The Espruino Wifi chip itself supports SPI slave mode, the source code library for this chip includes SPI slave mode already, so it seems feasible.
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.
If you want to use SPI I would suggest extending the Espruino SPI class to support slave mode. The Espruino Wifi chip itself supports SPI slave mode, the source code library for this chip includes SPI slave mode already, so it seems feasible.