title: How can I make the Node REPL print the result only?
body: <p>I want to run a script using <code>.load myFile.js</code> but I dont want to print everything that is in the file, only the value/result of whatever is the file. I'm using Electron, xterm.js, and node-pty for my project.</p>
  
  <p>For example, with this code:</p>
  
  <pre><code>// type your code here
  
  function sum(x, y) {
    return x + y
  }
  
  sum(2, 3)
  </code></pre>
  
  <p>I get something like this:</p>
  
  <pre><code>&gt; // type your code here
  undefined
  &gt; function sum(x, y) {
  ...   return x + y
  ... }
  undefined
  &gt; sum(2, 3)
  5
  &gt;
  </code></pre>