title: how to use NodeJS to modify a file and save to a new one?
body: <p>I have a plain text file named <code>source.txt</code></p>
  
  <p>I want to use a NodeJS script to do something to modify the content of the txt file and save as a new file, say <code>output.txt</code></p>
  
  <p>How do I do that?</p>
  
  <p>I am expecting a command-line implementation, something like:</p>
  
  <p><code>$node modify.js source.txt output.txt</code></p>
  
  <p>Thanks!</p>