In ES6 and later we prefer import over require.
In the absence of the require object, how does one access values historically presented as attributes of the require object? For example, require.main.filename
If there is a topic in the Node documentation dealing with this a reference would be greatly appreciated. In the meantime, I persist while Google fails to be my friend... obviously I'm asking the wrong question. Better search terms would also be helpful.
Accessing properties on the require function has been replaced by accessing the import.meta object in ES modules. It allows implementations to expose metadata about the module in a standard location.
Node.js in particular currently supports import.meta.url (like CommonJS __filename and __dirname) and import.meta.resolve (like require.resolve). The discussion about adding import.meta.main appears to have stalled.