Let me explain something further about the code we discussed in our last episode.

image.png

fs.readFileSync("./file.txt", "utf8");

This function reads the contents of a file synchronously, meaning it will actually block the main thread while it’s running.

image.png

What does this mean?

Why is this important?

Best Practice


Let me show you another example of blocking code in Node.js.

Introducing the crypto Module