How to use the node-red.events function in node-red

To help you get started, we’ve selected a few node-red examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sakazuki / aws-serverless-node-red / lambda.js View on Github external
return new Promise((resolve, reject) => {
    let deployed;
    RED.events.on("runtime-event", deployed = function(data){
      if (data.id === "runtime-deploy") {
        RED.events.removeListener("runtime-event", deployed);
        // console.log('flow deployed');
        resolve();
      }
    })
    RED.start();
  });
})()
github sakazuki / aws-serverless-node-red / lambda.js View on Github external
function clearHandlers(){
        for(var key in handlers) RED.events.removeListener(key, handlers[key]);
      }
      function setHandlers(){