I can use process.argv
to get an array of arguments passed to the NodeJS program, but is there a way to get the full exact command line string entered on the shell that the NodeJS program was launched with? If not the exact string, is there any close equivalent that can be determined?
process.argv
is the correct way. As a start, you can do:
console.log(process.argv.join(" "))
Then you can change paths to relative paths if you wish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With