method
http2.Http2SecureServer.listeners
listeners<E extends keyof Http2SecureServerEventMap<typeof IncomingMessage, typeof ServerResponse, typeof Http2ServerRequest, typeof Http2ServerResponse>>(
eventName: E
): (...args: Http2SecureServerEventMap<Http1Request, Http1Response, Http2Request, Http2Response>[E]) => void[];
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] ]eventName: string | symbol
): (...args: any[]) => void[];
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] ]