title: Pass more dynamic run time arguments to NodeJS child process
body: <p>I want to run a Java program using NodeJS child process.</p>
  
  <pre><code>const util = require('util');
  const exec = util.promisify(require('child_process').exec);
  
  let dir = `${__dirname}/runtime/java/main`;
  
  await exec(`javac Test.java`, {cwd: dir});
  const { stdout, stderr } = await exec(`java Test`, {cwd: dir});
  </code></pre>
  
  <p>My Java code is taking multiple scanner run time arguments dynamically: </p>
  
  <pre><code>import java.util.Scanner; 
  
  class Test {
    public static void main(String[] args) {
      Scanner scanner = new Scanner(System.in);  
      System.out.println("Enter number of test cases");
  
      int count = scanner.nextInt();  
      for(int i=0; i&lt;count; i++){
        String testCaseDescription = scanner.nextLine();  
        System.out.println("Test case " + i + " is "+testCaseDescription);  
      }
  
    }
  }
  </code></pre>
  
  <p>How do I pass dynamic run-time parameters to the child process?</p>