Search code examples
javascriptnode.jsemit

What is `emit` javascript function?


While looking through sax nodejs module, i saw multiple emit function calls, but i can't find any information about it.

Is it some V8 native tool for emitting events? Why sax-js do not use EventEmitter for streams then?


Solution

  • Please look at line number 624 of the same file.

    function emit (parser, event, data) {
    
      parser[event] && parser[event](data)
    
    }