title: Parsing Javascript Functions from text file
body: <p>So I guess this is kinda a crazy out there question as I haven't found much in terms of references to it but maybe I've just been looking in the wrong place. What I'm setting out to do is to take my entire Javascript program (that exists in a single file) and I want to store it in the equivalent of a string. </p>
  
  <p>I want to then take a secondary program that reads that string that contains my javascript code and execute it as if it was a normal javascript file. For example sets of code I have this as a structure of the code that would be in the string</p>
  
  <pre><code>var adminRole;
  var account;
  var color;
  function sayHello() {
      console.log('hello');
  };
  sayHello()
  </code></pre>
  
  <p>If that code was stored in a plain text file. Is there any simple way to then turn it all into javascript code and evaluate it like you normally would? </p>