Simple cross-platform JavaScript event emitter