title: How can I change my callback function to promise?
body: <p>This is my node js callback function, I want to change this functions to promise.</p>
  
  <pre><code>service.parseToCsv('resources/' + peopleFileName, (err,people) =&gt; {
         if(err){
             res.status(400).send('ERROR TO PARSING CSV PEOPLES');
         } else{
             Entry.insertPeoples(people,(err,results) =&gt; {
                 if(err){
                     let rmPath = 'resources/' + peopleFileName;
                     fs.unlink(rmPath);
                     res.status(400).send('ERROR TO INSERT PEOPLE DATA IN TO DATABASE');
                 } else{
                     service.parseToCsv('resources/' + facilityFileName,(err,facilities) =&gt; {
                         if(err){
                             console.log(err);
                             res.status(400).send('ERROR TO PARSING CSV FACILITIES');
                         } else{
  
                             res.status(200).send(facilities);
  
                         }
                     })
                 }
             });
         }
      });
  </code></pre>
  
  <p>I want to see example code.</p>