javascript load text file to string code example
Example 1: javascript store text file into string
var fs = require("fs");
fs.readFile("./mytext.txt", function(text){
var textByLine = text.split("\n")
});
Example 2: extract string from text file javascript
$(function () {
$.get('/your_file.txt', function (data) {
words = data.split('\s');
});
});