In this article, we have list 4 things you should know when learning NodeJS.
Streams & Buffer
Events & Event Emitters
When you start working with streams, you can’t help to notice that you listen to stream events and this is because it uses event emitters (event module) to send the various types of events like “error”, “end” and “data”.
NodeJs is built around an idiomatic asynchronous event-driven architecture where emitters run the show. So, you should learn to integrate events in your application because almost everything in Node produces events. Try to create your own events and utilize the event emitter.
Module & Architecture
Modular architecture and Modules play big part in Node. The idea that every file is a module with its own scope and you can choose what to expose or not pretty much defines NodeJs applications.
So how actually NodeJs Modules work? It works by using a function that inject global things, like exports and require to wrap the code in your file. Being aware of that, will make you understand about how communication is done, what are the limits, the importance of Events, and facilitates the building of workers and threads.
Mastering file System or fs module is important because at the end of the day you will work with the server-side. You will have to read and write files and collect information from them. Which means you need the knowledge and skill to read files and directories, perform CRUD operations, and collect details. When interacting with the File System you will automatically interact with streams and events as well, which further highlights the need to learn those concepts in depth.