Converted event.js module to es6