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