title: How to actually use Q promise in node.js?
body: <p>This might be a noob question, but I'm new to promises and trying to figure out how to use <a href="https://github.com/kriskowal/q" rel="noreferrer">Q</a> in node.js.</p>
  
  <p>I see the <a href="https://github.com/kriskowal/q#tutorial" rel="noreferrer">tutorial</a> begins with a </p>
  
  <pre><code>promiseMeSomething()
      .then(function (value) {}, function (reason) {});
  </code></pre>
  
  <p>but I fail to grasp where exactly does the <code>.then</code> came from. I guess it comes from </p>
  
  <pre><code>var outputPromise = getInputPromise()
      .then(function (input) {}, function (reason) {});
  </code></pre>
  
  <p>but where does <code>getInputPromise()</code> come from? I find no previous mention of it.</p>
  
  <hr>
  
  <p>I have included it in my project like so</p>
  
  <pre><code>var Q = require('q');
  
  // this is suppose, the async function I want to use promise for
  function async(cb) {
      setTimeout(function () {
          cb();
      }, 5000);
  }
  
  async(function () {
      console.log('async called back');
  });
  </code></pre>
  
  <p>How do I use <code>Q</code> and its <code>.then</code> here in my example?</p>