I am new to NodeJS. The following code snippet from my script is not executing nor it is logging any errors.

console.log('Process attachment');

```
          const simpleParser = require('mailparser').simpleParser;

          console.log('Process attachment');

          simpleParser(data.Body, (err, mail) => {
              if (err) {
                  console.log('attachment error');
                  console.log(err)
                  callback(null, null);
              } else {
                  console.log('attachment success');
                  console.log(mail)
                  console.log(mail.attachments[0])
                  console.log(mail.attachments[0].content)
                  console.log(mail.attachments[0].content.toString('ascii'))
                  callback(null, null);
              }
          })

          console.log('Exit');
          process.exit(); 

```

Process attachment and Exit are being logged in the console but for some reason the code never goes in either the if or the else. So it looks like the simpleParser function is not being executed for some reason. data.Body contains a full email body. Is there anything obvious i am missing ? Thanks.