emit data event is used to return the results of the component execution.

Here an example how it can be used:

function emitData() {
    console.log('About to say hello to ' + name + ' again');

    var body = {
      greeting: name + ' How are you today?',
      originalGreeting: msg.body.greeting
    };

    var data = messages.newMessageWithBody(body);

    self.emit('data', data);
  }

Here is anouther example of usage:

function emitData(result) {
        console.log("Emitting data");
        var body = result.body;

        console.log(_.pick(body, ['sku', 'quantityOnStock']));

        var msg = messages.newMessageWithBody(body);

        self.emit('data', msg);
 }