GoConqr has a new look! Let us know what you think.

Module 17 of 22 · Media

Write to a file async

Kostas Diakogiannis

Write to a file async

Write to a file async

Exactly like we have done with reading the file, we will use the fs.promise module to write to a file asynchronously and don't block our script from further execution. For that we will use the fs.write function of the filesystem and will wrap it as previous into a promise (in order to avoid callback hell) as it is shown above.

Give it a go and test that your file contains what you want.

 

 

 

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?