code: function getNextResponse(){
      if (_waitingForInput !== null){
          throw new Error('concurreny error - receive listener already in-queue');
      }
  
      return new Promise(function(resolve){
          // data received ?
          if (_inputbuffer.length > 0){
              resolve(_inputbuffer.shift());
          }else{
              // add as waiting instance (no concurrent!)
              _waitingForInput = resolve;
          }
      });
  }
docs: wait for next echo + response line