title: Node.js, 'X' is not defined
body: <p>I've been pulling my hair out with this one, trying to get my latest tweets as an array with <a href="https://github.com/noffle/latest-tweets" rel="nofollow noreferrer">https://github.com/noffle/latest-tweets</a> npm module. however, no matter what way i seem to order it, i get some form of error. mainly posts is not defined
  or tweets is not defined.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var express = require('express');
  var latestTweets = require('latest-tweets')
  var Post = require('../models/blog');
  var router = express.Router();
  
  
  router.get('/', function (req, res) {
   Post.getPosts((err, posts) =&gt; {
    if(err){
     throw err;
    }
   });
   latestTweets('my_twitter_id', function (err, tweets) {
     console.log(tweets)
   })
      res.render('index', {tweets : tweets, posts : posts});
  
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>I also tried to export the latestTweets function into a helper class which lead to more issues.</p>