Hey, that’s a very good question and it is very possible! The below example I created would take each reply from a text-file named
replies.txt and put them into an array named
// Include the file-system module const fs = require("fs"); // Read the text file that contains all replies let reply_data = fs.readFileSync("./replies.txt").toString(); // Take each reply in the text file and put them into an array let replies = reply_data.split("\n"); // As an example, we will print each reply separately replies.forEach((reply) => console.log(reply));
Hope this works for you!