ipc-promise.js
function on(event, listener) {
    // call from main process always.

    // add listener to common event emitter for main process.
    cee.on(event, function(id, data, ipcEvent) {
      listener(data, ipcEvent)
        .then(function(result) {
          cee.emit(getSuccessEventName(event, id), result);
        })
        .catch(function(result) {
          cee.emit(getFailureEventName(event, id), result);
        });
    });
  }
function on(event, listener) {
    // call from main process always.

    // add listener to common event emitter for main process.
    cee.on(event, function(id, data, ipcEvent) {
      listener(data, ipcEvent)
        .then(function(result) {
          cee.emit(getSuccessEventName(event, id), result);
        })
        .catch(function(result) {
          cee.emit(getFailureEventName(event, id), result);
        });
    });
  }
function on ( event , listener ) { // call from main process always. // add listener to common event emitter for main process. cee . on ( event , function ( id , data , ipcEvent ) { listener ( data , ipcEvent ) . then ( function ( result ) { cee . emit ( getSuccessEventName ( event , id ) , result ) ; } ) . catch ( function ( result ) { cee . emit ( getFailureEventName ( event , id ) , result ) ; } ) ; } ) ; }
listen event.

@param {String} event event name.
@param {Function} listener listener function.
listen event .