yargs / require-main-filename

shim for require.main.filename() that works in as many environments as possible
ISC License
18 stars 9 forks source link

Does not work when main script is ES module #49

Open coreyfarrell opened 4 years ago

coreyfarrell commented 4 years ago

node script.mjs results in require.main being undefined. I'm addressing this within the next version of tap at https://github.com/tapjs/libtap/pull/21. A bit ugly but I'm using process.argv[1] as long as we're not in REPL and we're not evaluating with any form of node -p or node -e.