Skip to main content
Go to Latest
method default.prototype.listeners
import { default } from "https://deno.land/std@0.158.0/node/events.ts";

Returns a copy of the array of listeners for the event named eventName.

server.on('connection', (stream) => {
  console.log('someone connected!');
});
console.log(util.inspect(server.listeners('connection')));
// Prints: [ [Function] ]

Parameters

eventName: string | symbol

Returns

Function[]