PHP shell_exec将数据传递给cmd“node x.js”并读入js

I am trying to send data from php to js file from my server to fetch the output.

these are my files content:

helloworld.php :

$output = shell_exec('node helloworld.js "'.'test1'.'"');
echo "<pre>$output</pre>";

helloworld.js :

console.log ([THIS IS WHERE I WANT TO DETECT THE STRING "test1"]);

the command that i used is

php helloworld.php

Can anyone help me on how to send variable or data to the JS files?

Thanks