-
-
Notifications
You must be signed in to change notification settings - Fork 1
Tutorial 04 Parse argv
Sam Cao edited this page Jun 30, 2023
·
7 revisions
In this tutorial, you are going to learn:
- How to pass the command-line arguments.
- How to leverage any Node.js command-line argument modules.
- Usually
process.argv
carries the command-line arguments in Node.js, however,process.argv
only has one argument which is the path ofjava
. Jaspiler exposesjaspiler.argv
for the scripts to get the command-line arguments. Please be aware thatjaspiler.argv[0]
is the script path. The backward compatible way is to update theprocess.argv
.
process.argv = [process.argv[0], ...jaspiler.argv];