module.exports = path.dirname(process.mainModule.filename)
Main Module Deprecated
process.mainModule.filename is deprecated in nodejs. Is there any alternative method to get a current directory of the file?
require.main.filename.__dirname gets you the directory the module is in.process.cwd() gets the current working directory.Chances are you want one of these.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With