title: Passing Variable from NodeJS to client-side JS file
body: <p>Is it possible to pass a server-side JavaScript variable to a <code>&lt;script&gt;</code> tag in an HTML view?</p>
  
  <p>In my routes file I have:</p>
  
  <pre><code>exports.index = function(req, res){
    res.sendfile('views/index.html', {
        data: {foo: bar}
    });
  };
  </code></pre>
  
  <p>If I was using a Jade template, I could do:</p>
  
  <pre><code>script(type='text/javascript').
    var local_data =!{JSON.stringify(data)}
  </code></pre>
  
  <p>To access the <code>data</code> object. However, that doesn't work for an html file. Is there a work-around for this?</p>