Is it possible to open a text file with JavaScript (location like http://example.com/directory/file.txt) and check if the file contains a given string/variable?
In PHP this can be accomplished easily with something like:
$file = file_get_contents("filename.ext");
if (!strpos($file, "search string")) {
echo "String not found!";
} else {
echo "String found!";
}
Is there a way to do this? I'm running the "function" in a .js
file with Node.js, appfog.