Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://en.wikipedia.org/wiki/V8_%28JavaScript_engine%29" rel="nofollow noreferrer">V8</a> is an implementation of JavaScript. It lets you run standalone JavaScript applications (among other things).</p> <p>Node.js is simply a library written for V8 which does evented I/O. This concept is a bit trickier to explain, and I'm sure someone will answer with a better explanation than I... The gist is that rather than doing some input or output and waiting for it to happen, you just <em>don't</em> wait for it to finish. So for example, ask for the last edited time of a file:</p> <pre><code>// Pseudo code stat( 'somefile' ) </code></pre> <p>That might take a couple of milliseconds, or it might take seconds. With evented <a href="http://en.wikipedia.org/wiki/Input/output" rel="nofollow noreferrer">I/O</a> you simply fire off the request and instead of waiting around you attach a callback that gets run when the request finishes:</p> <pre><code>// Pseudo code stat( 'somefile', function( result ) { // Use the result here } ); // ...more code here </code></pre> <p>This makes it a lot like JavaScript code in the browser (for example, with <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29" rel="nofollow noreferrer">Ajax</a> style functionality).</p> <p>For more information, you should check out the article <em><a href="http://simonwillison.net/2009/Nov/23/node/" rel="nofollow noreferrer">Node.js is genuinely exciting</a></em> which was my introduction to the library/platform... I found it quite good.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload