GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 16 von 22 · Medien

Write to a file

Kostas Diakogiannis

Write to a file

Writing to a file

Now it is time to write to a file. 

We will create a string variable with some text of our choice, and we will try to write the content of this text into an empty file. 

First let's remove the previous content from the .txt file. Then after creating the text inside our script we will use the writeFileSync function to write to a file synchronously as it is shown above. When the operation is finished, we can check the content's of the .txt file by opening it. It should have the text you have defined. 

A massive success!!

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck