title: Applying multiple parameters to callback without promises - node-js
body: <p>In my little program, I try to unshorten an URL and then check if the link matches my pattern. If it does I want to further process it. But I also need to apply 3 parameter previously known.</p>
  
  <p>My code feels very clunky dragging along all 3 parameters to each function. How can I streamline this without promises?</p>
  
  <pre><code>var request = require("request");
  
  function expandUrl(shortUrl, a,b,c, callback) {
      request( { method: "HEAD", url: shortUrl, followAllRedirects: true },
          function (error, response) {
              callback(response.request.href, a,b,c);
          });
  }
  
  
  function checklink(unshortenedLink, a, b, c){
      matches = unshortenedLink.match(/twitter\.com\/\w+/g);
      if(matches){
          matches.forEach(function(result){
              process_twitter_link(result, a, b, c);
          });
      }
  }
  
  function process_twitter_link(link, a, b ,c ){
      console.log(link + " " + a + " " + b + " " + c);
      // std.out: twitter.com/StackJava param_a param_b param_c
  }
  
  expandUrl("https://t.co/W0DA8WVpmO", "param_a", "param_b", "param_c", checklink);
  </code></pre>