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.
node script.mjs
results inrequire.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 usingprocess.argv[1]
as long as we're not in REPL and we're not evaluating with any form ofnode -p
ornode -e
.