title: Having problems with passing array to jade template in node.js
body: <p>I am trying to pass array of news to display on the screen but I somehow am getting empty array in the result in the browser</p>
  
  <p><strong>routes/rss.js</strong></p>
  
  <pre><code>...
  var news = [];
  ...
            var this_news = { 
              'title': item.title,
              'description': item.description
            }   
            news.push(this_news);
  ...
    res.render('rss', { 
      title: 'Node.js based RSS reader',
      newsi: JSON.stringify(news)
    }); 
  </code></pre>
  
  <p><strong>views/rss.jade</strong></p>
  
  <pre><code>extends layout
  
  block content
    h1= title
    p Welcome to #{title}
    p Sure why not 
    script(type='text/javascript').
      var inews = !{newsi};
  </code></pre>
  
  <p><strong>EDIT</strong> </p>
  
  <p>Ok so I have come to the conclusion that the problem lies with my 'non-callback logic'</p>
  
  <p>that's my code : </p>
  
  <pre><code>var FeedParser = require(__dirname + '/../node_modules/feedparser')
    , request = require(__dirname + '/../node_modules/request');
  
  exports.news = function(req, res){
  
    var news = []; 
      request('http://feeds.feedburner.com/niebezpiecznik/')
      .pipe(new FeedParser())
        .on('error', function(error) {
          //...
        })  
        .on('meta', function (meta) {
          console.log('===== %s =====', meta.title);
          console.log('**** %s ****', meta.description);
          console.log();
        })  
        .on('readable', function() {
          var stream = this, item;
          while (item = stream.read()) {
  
            var this_news = { 
              'title': item.title,
              'description': item.description
            }   
            news.push(this_news);
  
          }   
          res.render('rss', { 
            title: 'Node.js based RSS reader',
            newsi: JSON.stringify(news)
          }); 
      }); 
  
  };
  </code></pre>
  
  <p>It almost works but there it gets me unhandled exception. How should I handle this ? </p>