title: Repeated asking of user input w/ Node?
body: <p>very new to JS/Node here. I'm trying to write a very simple Node program to repeatedly ask the user to type in names of diners until he/she types the keyword <code>done</code>. I am using the prompt npm package (<a href="https://www.npmjs.com/package/prompt" rel="nofollow">https://www.npmjs.com/package/prompt</a>).</p>
  
  <pre><code>var prompt = require('prompt');
  
  // Start the prompt
  prompt.start();
  
  var currentDinerName = "";
  var done = false;
  
  while (done !== true) {
      // Ask for name until user inputs "done"
      prompt.get(['name'], function(err, result) {
          console.log('Diner name: ' + result.name);
          currentDinerName = result.name;
          if (currentDinerName === 'done') {
              console.log('We are done.');
              done = true;
          }
      });
  }
  </code></pre>
  
  <p>However, I'm getting a memory leak -- it doesn't like this <code>while</code> loop. What is the proper way to do this in Node/JS?</p>
  
  <p>Thanks.</p>