node-rootdir

esm cjs
If you are a author of open source repository, you may want to support both commonjs and es-module for users since it's a confused period. It's hard to use `__dirname` and `import.meta.url` in one file specially for typescript project.