tl;dr - __dirname and package information are a bit harder to get from an ES module. In case you’re not using them yet, take a second to read up on Javascript (“ES” – EMCAScript) modules – they’re quite the large feature/platform change, big steps up (mostly) from CommonJS and RequireJS (AMD). One of the things that isn’t quite as nice as RequireJS in NodeJS-land was is how difficult it is to programmatically get package and version information!