title: How to keep a node.js script alive while promises are being resolved?
body: <p>My script performs some asynchronous tasks using promises (with the q library). Running mocha tests works fine. However running the script from the command line does not. The node process immediately dies.</p>
  
  <pre><code>var bot = require('./bot');
  
  bot.getCategories().then(function (categories) {
    console.log('Found ' + categories.length + ' categories');
  });
  </code></pre>