選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

event-listener-count.js 338B

12345678910111213141516171819202122
  1. /*!
  2. * depd
  3. * Copyright(c) 2015 Douglas Christopher Wilson
  4. * MIT Licensed
  5. */
  6. 'use strict'
  7. /**
  8. * Module exports.
  9. * @public
  10. */
  11. module.exports = eventListenerCount
  12. /**
  13. * Get the count of listeners on an event emitter of a specific type.
  14. */
  15. function eventListenerCount (emitter, type) {
  16. return emitter.listeners(type).length
  17. }