title: Using SetInterval in node.js REPL?
body: <p>Say I have the following javascript file:</p>
  
  <pre><code>function logMe() {
    for(var i=0; i &lt; 4; i++) console.log(i);
  }
  
  setInterval(logMe(), 2000);
  </code></pre>
  
  <p>Then I open a node.js REPL with the command <code>node</code>.</p>
  
  <p>I then load and evaluate my script with:</p>
  
  <pre><code>eval(fs.readFileSync('myScript.js').toString())
  </code></pre>
  
  <p>I get back the error:</p>
  
  <pre><code>TypeError: "callback" argument must be a function
      at exports.setInterval (timers.js:414:11)
      at eval (eval at &lt;anonymous&gt; (repl:1:68), &lt;anonymous&gt;:5:1)
      at repl:1:1
      at sigintHandlersWrap (vm.js:22:35)
      at sigintHandlersWrap (vm.js:96:12)
      at ContextifyScript.Script.runInThisContext (vm.js:21:12)
      at REPLServer.defaultEval (repl.js:346:29)
      at bound (domain.js:280:14)
      at REPLServer.runBound [as eval] (domain.js:293:12)
      at REPLServer.&lt;anonymous&gt; (repl.js:545:10)
  </code></pre>
  
  <p>Is there a potential work around here if I want to use setInterval within the node REPL?</p>