Last active
February 14, 2023 12:49
-
-
Save dcortesnet/07a91347b778e75d67499cda36419dd7 to your computer and use it in GitHub Desktop.
Nodejs lectura de archivo síncrono txt
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
const fs = require("fs"); | |
const data = fs.readFileSync("./text.txt", { encoding: "utf-8", flag: "r" }); | |
const arr = data.toString().replace(/\r\n/g, "\n").split("\n"); | |
console.log(arr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment