npm module: attach cancelable event listeners