Hello,
Maybe someone else can give a better suggestion but I think, this way, described in the link, would be a good and flexible way. MQTT is a good choice, it is supported natively by Node-RED, it is used "everywhere" when connecting devices in computers and over networks. It also gives you freedom to easily share data to several consumers
Anyway, the concept is:
Sharp IR sensor -> Cylon.js -> MQTT ---------- MQTT -> Node-RED
https://www.rs-online.com/designspark/building-an-mqtt-enabled-application-with-cylon-js