I'm using the following code to pass javascript source code (as a string) as stdout to anther command.
exec(`echo "${jsCodeHere}" | someOtherCommand`)
The issue with this is there are a bunch of issues caused by the syntax of javascript being evaluated by bash. Is there a better way of doing this?