title: Redirecting node.js output to text file using shell script
body: <p>I want to redirect the output of node.js to txt file.I am able to get the output in console for node.js.</p>
  
  <p>Please help me in this issue.</p>
  
  <p>This is the snippet:</p>
  
  <pre><code>node.forEach(function(elem)
  {
  var toString=elem.path.toString;
  console.log(toString);
  }
  </code></pre>
  
  <p>Output looks something like this</p>
  
  <pre><code>ui.apps/src/main/content/jcr_root/components/content/smartcart/deviceselector/cq_editConfig.xml
  ui.apps/src/main/content/jcr_root/components/content/smartcart/deviceselector/deviceselector.html
  </code></pre>