Stability: 1 - Experimental

    The EventTarget and Event objects are a Node.js-specific implementation of the [EventTarget Web API][] that are exposed by some Node.js core APIs. Neither the EventTarget nor Event classes are available for end user code to create.

    1. const target = getEventTargetSomehow();
    2. target.addEventListener('foo', (event) => {
    3. console.log('foo event happened!');
    4. });