How can I detect whether my Node.JS file was called using SH:node path-to-file
or JS:require('path-to-file')
?
This is the Node.JS equivalent to my previous question in Perl: How can I run my Perl script only if it wasn’t loaded with require?
How can I detect whether my Node.JS file was called using SH:node path-to-file
or JS:require('path-to-file')
?
This is the Node.JS equivalent to my previous question in Perl: How can I run my Perl script only if it wasn’t loaded with require?