code: function setOutput(msg, outputType, output, value) {
        try {
          switch ( outputType ) {
            case 'msg':
              RED.util.setMessageProperty(msg, output, value);
              break;
            case 'flow':
              node.context().flow.set(output, value);
              break;
            case 'global':
              node.context().global.set(output, value);
              break;
            default:
              node.warn('Unrecognised Output Type, ' + outputType + '. No output.');
          }
        } catch (err) {
          node.warn('Output property, ' + outputType + '.' + output + ', cannot be set. No output.', err);
        }
      }
docs: Tidy up if we need to node.on('close', function() { Called when the node is shutdown - eg on redeploy. Allows ports to be closed, connections dropped etc. eg: node.client.disconnect(); }); Set the appropriate output variable