Skip to content

Instantly share code, notes, and snippets.

@rpivo
Created April 11, 2021 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpivo/870385d6487bf980fbbf5f1cf7b0f6c5 to your computer and use it in GitHub Desktop.
Save rpivo/870385d6487bf980fbbf5f1cf7b0f6c5 to your computer and use it in GitHub Desktop.
Listing All Events Registered On a Node EventEmitter

Listing All Events Registered On a Node EventEmitter

import http from "http";

const server = http.createServer((_, res) => {
  res.end();
});

console.log({ eventNames: server.eventNames()});

// { eventNames: [ 'request', 'connection', 'clientError' ] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment