title: process.mainModule is deprecated in nodejs
body: <pre><code>module.exports = path.dirname(process.mainModule.filename)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/IBzIV.png" rel="nofollow noreferrer">Main Module Deprecated</a></p>
  <p>process.mainModule.filename is deprecated in nodejs.
  Is there any alternative method to get a current directory of the file?</p>