var fs = require("fs"); fs.readFile("./mytext.txt", function(text){ var textByLine = text.split(" ") });