Node.js code that interfaces devices with the Ninja platform