Created
December 27, 2018 13:15
-
-
Save parzibyte/a472e14b345b1d09177de279f31be4c4 to your computer and use it in GitHub Desktop.
Leer archivo de texto completo con Node.JS created by parzibyte - https://repl.it/@parzibyte/Leer-archivo-de-texto-completo-con-NodeJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hola, soy un archivo de texto para demostrar algunos tutoriales de parzibyte.me. Puedo contener cualquier tipo de contenido, por ejemplo, saltos, | |
tabulaciones | |
y cualquier | |
otra | |
cosa. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Leer todo el contenido de un archivo | |
* con Node.JS y fs | |
* | |
* @author parzibyte | |
*/ | |
const fs = require("fs"), | |
NOMBRE_ARCHIVO = "archivo.txt"; | |
fs.readFile(NOMBRE_ARCHIVO, 'utf8', (error, datos) => { | |
if (error) throw error; | |
console.log("El contenido es: ", datos); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment