¡GoConqr estrena diseño! Cuéntanos qué te parece.

Módulo 16 de 22 · Multimedia

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!!

Instrucciones

Para avanzar en el curso, envía un intento de este test. Puedes enviarlo después de la última pregunta.

Ir al módulo elegido

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?