Skip to content

Tutorial 04 Parse argv

Sam Cao edited this page Jun 30, 2023 · 7 revisions

Goals

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.

Steps

  • Usually process.argv carries the command-line arguments in Node.js, however, process.argv only has one argument which is the path of java. Jaspiler exposes jaspiler.argv for the scripts to get the command-line arguments. Please be aware that jaspiler.argv[0] is the script path. The backward compatible way is to update the process.argv.
process.argv = [process.argv[0], ...jaspiler.argv];
Clone this wiki locally