Answers for "read text file and store in string js"

1

read text in txt file js

const fs = require('fs')

fs.readFile("File.txt", (err, data) => {
	if (err) throw err;
	console.log(data);
})
Posted by: Guest on April-03-2021
1

javascript store text file into string

var fs = require("fs");
fs.readFile("./mytext.txt", function(text){
    var textByLine = text.split("\n")
});
Posted by: Guest on November-01-2020

Code answers related to "read text file and store in string js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language