Skip to content
Advertisement

How to read and open two different files in nodejs?

I have observed in this code that we can’t open the file after we have readFile.

The computer complains about Error [ERR_STREAM_WRITE_AFTER_END]: write after end

Of course if I remove the readFile function then this error goes away but I want to understand why this error is occurring even though I am using two different files for reading and opening.

What is the way to read and open two different files?

JavaScript

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement