I'm aware that, when using ES modules, __filename
and __dirname
don't exist.
This is clearly stated in Node.js documentation, and also alternatives can be found in several places, like this answer.
What I'm missing here is the cause of this behavior. Why are these variables not available in ES modules?
I could not find an explanation on SO or in the Node docs.