title: Runing newman inside of nodejs module
body: <p>I have a nodejs module with a class.</p>
  
  <p>Inside of the the class there is a method which calls newman (Postman cli runner)</p>
  
  <p>Can't figure out the way how to return newman run result data.
  The newman call itself (outside of module) works without any problem.</p>
  
  <p>mymodule.js</p>
  
  <pre class="lang-js prettyprint-override"><code>var newman = require('newman');
  
  module.exports =  function (collection, data) {
      this.run = function () {
  
          newman.run({
              collection: require(this.collection + '.postman_collection.json'),
              environment: require(this.environment + '.postman_environment.json')
          }, function () {
              console.log('in callback');
          }).on('start', function (err, args) { 
  
          }).on('beforeDone', function (err, data) { 
  
          }).on('done', function (err, summary) {
  
          });
  
          return 'some result';
      }
  }
  </code></pre>
  
  <p>index.js</p>
  
  <pre class="lang-js prettyprint-override"><code>
  var runNewman = require('./mymodule');
  
  var rn = new runNewman(cName, cData);
  
  var result = rn.run(); // never returns any variable
  cosole.log(result); 
  
  </code></pre>