// Change to 80 or 150 whatever and see what happens
require('events').EventEmitter.prototype._maxListeners = 70;
require('events').defaultMaxListeners = 70;
process.on('warning', function (err) {
if ( 'MaxListenersExceededWarning' == err.name ) {
console.log('o kurwa');
// write to log function
process.exit(1); // its up to you what then in my case script was hang
}
});