What are events in Node?
An event is something that happened in your app. You can react to this event happening. A user may tap a button in your app, and the code you wrote has been listening to when this event may happen. Once this event happens, you’ll likely have written code that does something in response to this event (saving some data to a database, sending the user to another page, both.)
Node.js has a built-in module, called “Events”, where you can create-, fire-, and listen for- your own events. There is also the EventEmitter Object. Here’s a common example of it being used. In that example we’ve created a function that only runs when the ‘scream’ event happens.