title: How to execute Javascript in a bash script?
body: <p>I have made a bash script that reads a file line by line and returns what is on that line, though what I want to do is have that bash script run a JS function with what exists in that file and return to the user running the script the output of that JS function. </p>
  
  <p>How can I complete that? I am using a node.js backend and this what my script currently looks like.</p>
  
  <pre><code>#!/bin/bash
  while IFS='' read -r line || [[ -n "$line" ]]; do
      echo "Text read from file: $line"
  done &lt; "$1"
  </code></pre>
  
  <p>for example if my file contains two lines that are 2 and 4 and I have a JS file that multiplies by 2 how can I get this bash script to return 4 and 8 by running that method on each line.</p>