title: Read A Server Side File Using JavaScript
body: <p>I have on my web server a JS script that I want to be able to read files.
  My filesystem is like this:</p>
  
  <pre><code>&gt; Root
  index.html
  read.js
  &gt; files
      file.txt
  </code></pre>
  
  <p>In this example, the file "file.txt" will contain the simple word "Hello"</p>
  
  <p>With JavaScript, I wish to be able to make a function, for example:</p>
  
  <pre><code>function read (path) {
      //Stuff to read the file with specified path
      var content = //whatever the content is
      return content;
  }
  </code></pre>
  
  <p>And then be able to call it with:</p>
  
  <pre><code>var file = read("/files/file.txt")
  </code></pre>
  
  <p>And then when I do</p>
  
  <pre><code>alert(file)
  </code></pre>
  
  <p>It will pop up with/alert you with "Hello", the content of file.txt.</p>
  
  <p>Is there any way that I would be able to do this?</p>