title: Why I can not see results of form data function in console NodeJs
body: <p>I am trying to receive in result fields value to operate them a little down in the code But I have undefined in console.log Please explaine why and how I can get my fields down in the code</p>
  
  <pre><code>var multiparty = require('multiparty')
  
  module.exports.login = function(req, res) {
      var form = new multiparty.Form();
   const result = form.parse(req, function(err, fields, files) {
        console.log(err, fields, files);
          return fields
      })
  console.log('result=&gt;',result)//undefined
  
      res.send('Hello from Express!')
  }; 
  </code></pre>
  
  <p>I understand that I need to use prommises but I dont know how, please show me by your code sample</p>
  
  <pre><code>    var multiparty = require('multiparty')
  
  module.exports.login = function(req, res) {
      var form = new multiparty.Form();
   var result  = () =&gt; { form.parse(req, function(err, fields, files) {
        console.log(err, fields, files);
        return new Promise(function(resolve, reject) {
         resolve(fields);
  
      })
  })}
  console.log('result=&gt;',result.resolve)
  
      res.send('Hello from Express!')
  };
  </code></pre>