An events based iteration JavaScript module