Summary
In this chapter, we learned about how to use events in Node.js. We learned about the EventEmitter
class and how to use it to emit and listen to events. We also learned how to use events to decouple the logic of our applications.
Additionally, we built a script to watch for changes in files in our system, and we also built our first HTTP server and learned how to handle requests using events.
Finally, we built a simple library that exports an event layer to decouple the logic of our applications. This will allow us to build more robust applications in future chapters.
In the next chapter, we will learn how to add tests to our applications. This will help us to build more robust applications, avoid bugs, and overall, consolidate our knowledge about Node.js while learning it.