</code></pre></td><tdclass="code"><divclass="highlight"><pre></pre></div></td></tr><trid="section-2"><tdclass="docs"><divclass="octowrap"><aclass="octothorpe"href="#section-2">#</a></div><p>Require the <strong>coffee-script</strong> module to get access to the compiler.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nv">CoffeeScript: </span><spanclass="nx">require</span><spanclass="s1">'./coffee-script'</span>
<spanclass="nv">helpers: </span><spanclass="nx">require</span><spanclass="p">(</span><spanclass="s1">'./helpers'</span><spanclass="p">).</span><spanclass="nx">helpers</span></pre></div></td></tr><trid="section-3"><tdclass="docs"><divclass="octowrap"><aclass="octothorpe"href="#section-3">#</a></div><p>Our prompt.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nv">prompt: </span><spanclass="s1">'coffee>'</span></pre></div></td></tr><trid="section-4"><tdclass="docs"><divclass="octowrap"><aclass="octothorpe"href="#section-4">#</a></div><p>Quick alias for quitting the REPL.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nx">helpers</span><spanclass="p">.</span><spanclass="nx">extend</span><spanclass="nx">global</span><spanclass="p">,</span><spanclass="p">{</span>
<spanclass="p">}</span></pre></div></td></tr><trid="section-5"><tdclass="docs"><divclass="octowrap"><aclass="octothorpe"href="#section-5">#</a></div><p>The main REPL function. <strong>run</strong> is called every time a line of code is entered.
of exiting.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nv">run: </span><spanclass="p">(</span><spanclass="nx">buffer</span><spanclass="p">)</span><spanclass="o">-></span>
<spanclass="nx">print</span><spanclass="nx">prompt</span></pre></div></td></tr><trid="section-6"><tdclass="docs"><divclass="octowrap"><aclass="octothorpe"href="#section-6">#</a></div><p>Start up the REPL by opening <strong>stdin</strong> and listening for input.</p></td><tdclass="code"><divclass="highlight"><pre><spanclass="nv">stdin: </span><spanclass="nx">process</span><spanclass="p">.</span><spanclass="nx">openStdin</span><spanclass="p">()</span>