title: NodeJS async.Whilst
body: <pre><code>var count = 0;
  
  async.whilst(
      function () { return count &lt; 5; },
      function (callback) {
          count++;
          setTimeout(callback, 1000);
      },
      function (err) {
          // 5 seconds have passed
      }
  );
  </code></pre>
  
  <p>is there a way for the first function to pass the variable to the second function to be processed. For example:</p>
  
  <pre><code>async.whilst(
      // if EOF data will evaluate to false
      // otherwise, data will be an object
      function () { var data = processSomeDataSync(); return data },
      function (data, callback) {
          process(data)
      },
      function (err) {
      }
  );
  </code></pre>