lib: don't use emitter.listeners(type).length