title: How to I view a variable when debugging in Node.js?
body: <p>The Node.js debugger hides most of my string variables, it prints <code>...</code> instead, like so: (there's a variable named <code>source</code>)</p>
  
  <pre><code>$ node debug 127.0.0.1:9101
  debug&gt; 
  debug&gt; exec('source')
  '&lt;!DOCTYPE html&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml" class="DW dw-pri js no... (length: 6408)'
  debug&gt;
  debug&gt; repl
  Press Ctrl + C to leave debug repl
  &gt; source
  '&lt;!DOCTYPE html&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml" class="DW dw-pri js no... (length: 6408)'
  </code></pre>
  
  <p>As you can see, it replaces most of the string, with <code>...</code>. I've googled for a while and typed <code>help</code> in the console. Finally posting here — how do I view the full contents of the string?  <code>console.log(source)</code> didn't do anything.</p>
  
  <p><em>Edit:</em> Now I noticed that <code>console.log</code> does print the variable, in Selenium's terminal window, which perhaps is what I ought to have expected. Not sure if <code>console.log</code> and switching to the Selenium terminal window, is what I'm supposed to do</p>
  
  <p><em>Update:</em></p>
  
  <p>Typing just <code>source</code> doesn't work, outside <code>repl</code>:</p>
  
  <pre><code>debug&gt; source
  ReferenceError: source is not defined
      at repl:1:1
      at ContextifyScript.Script.runInContext (vm.js:32:29)
      at Object.runInContext (vm.js:87:6)
      at Interface.controlEval (_debugger.js:971:21)
      at REPLServer.eval (_debugger.js:745:41)
      at bound (domain.js:280:14)
      at REPLServer.runBound [as eval] (domain.js:293:12)
      at REPLServer.onLine (repl.js:536:10)
      at emitOne (events.js:96:13)
      at REPLServer.emit (events.js:191:7)
  </code></pre>
  
  <p>(and when inside repl, the variable gets truncated, as shown in the topmost snippet above.)</p>
  
  <p>And <code>print(source)</code> or <code>print('source')</code>:</p>
  
  <pre><code>debug&gt; print('source')
  ReferenceError: print is not defined
      at repl:1:1
      at ContextifyScript.Script.runInContext (vm.js:32:29)
      at Object.runInContext (vm.js:87:6)
      at Interface.controlEval (_debugger.js:971:21)
      at REPLServer.eval (_debugger.js:745:41)
      at bound (domain.js:280:14)
      at REPLServer.runBound [as eval] (domain.js:293:12)
      at REPLServer.onLine (repl.js:536:10)
      at emitOne (events.js:96:13)
      at REPLServer.emit (events.js:191:7)
  debug&gt; repl
  Press Ctrl + C to leave debug repl
  &gt; print(source)
  ReferenceError: print is not defined
  </code></pre>
  
  <p>There aren't many commands to choose among: (in the debugger)</p>
  
  <pre><code>debug&gt; help
  Commands: run (r), cont (c), next (n), step (s),
  out (o), backtrace (bt), setBreakpoint (sb), clearBreakpoint (cb),
  watch, unwatch, watchers, repl, exec, restart, kill, list, scripts,
  breakOnException, breakpoints, version
  </code></pre>