NodeJS Felix

Embed Size (px)

Citation preview

  • 8/3/2019 NodeJS Felix

    1/31

    Felix's Node.js Guide

    About this guide

    Hi, I amFelix Geisendrfer, an earlynode.jscore contributor and co-founder oftransloadit.com.

    Over the past few months I have given a lot oftalksand done a lotofconsultingon using node.js.

    Since I found myself repeating a lot of things over and over, I decidedto use some of my recent vacation to start this opinionated andunofficial guide to help people getting started in node.js.

    Content

    Node.js Beginner GuideIf you are new to node.js, this guide will take you from hello

    world to deploying your first app.Node.js Style Guide

    The general JavaScript style I recommend to use with node.js. Alot of this is personal preferences, but hopefully ratherconsistent.

    Node.js Community GuideGet to know some of the node.js community and find out wherethey hang out.

    Node.js Convincing The Boss GuideFind out where node.js makes sense, and how to getmanagement to see the benefits.

    More guides are in the works. Feel free to follow theGitHub repository,or have a look at this list of upcoming guides:

    Node.js Package GuideLearn how to create your own node.js packages and publish themon npm.

    Node.js Object Oriented Programming GuideMy approach to object oriented programming with node.js.

    Node.js Test Driven Development GuideA beginners guide to test driven development with node.js.

    Report Issues

    http://twitter.com/felixgehttp://twitter.com/felixgehttp://twitter.com/felixgehttp://nodejs.org/http://nodejs.org/http://nodejs.org/http://transloadit.com/http://transloadit.com/http://transloadit.com/http://www.slideshare.net/the_undefined/presentationshttp://www.slideshare.net/the_undefined/presentationshttp://www.slideshare.net/the_undefined/presentationshttp://debuggable.com/http://debuggable.com/http://debuggable.com/http://nodeguide.com/beginner.htmlhttp://nodeguide.com/beginner.htmlhttp://nodeguide.com/style.htmlhttp://nodeguide.com/style.htmlhttp://nodeguide.com/community.htmlhttp://nodeguide.com/community.htmlhttp://nodeguide.com/convincing_the_boss.htmlhttp://nodeguide.com/convincing_the_boss.htmlhttps://github.com/felixge/nodeguide.comhttps://github.com/felixge/nodeguide.comhttps://github.com/felixge/nodeguide.comhttps://github.com/felixge/nodeguide.comhttp://nodeguide.com/convincing_the_boss.htmlhttp://nodeguide.com/community.htmlhttp://nodeguide.com/style.htmlhttp://nodeguide.com/beginner.htmlhttp://debuggable.com/http://www.slideshare.net/the_undefined/presentationshttp://transloadit.com/http://nodejs.org/http://twitter.com/felixge
  • 8/3/2019 NodeJS Felix

    2/31

    If you come across some incorrect information, please open an issue intheissue tracker.

    License

    I have not decided on a license for this yet. So if you're interested in re-publishing this content in one way or another, please send meanemail.

    2011, Debuggable Limited.

    https://github.com/felixge/nodeguide.com/issueshttps://github.com/felixge/nodeguide.com/issueshttps://github.com/felixge/nodeguide.com/issuesmailto:[email protected]:[email protected]:[email protected]://debuggable.com/http://debuggable.com/http://debuggable.com/http://debuggable.com/mailto:[email protected]://github.com/felixge/nodeguide.com/issues
  • 8/3/2019 NodeJS Felix

    3/31

    Home / All Guides

    Felix's Node.js Beginners Guide

    Learning JavaScript Hello World Tutorial

    o Installationo The interactive node.js shello Your first programo A hello world http server

    The module system Using EventEmitters Next Steps Debugging node.js apps

    o Using console.log()o Using the node debuggero Using the WebKit Inspector

    Frameworkso Expresso fab.js

    Hosting & Deploymento Quick & Dirty Deploymento Joyent no.de

    There is lots of information about node.js, but given the rapid pace atwhich it is developing, it can be difficult for beginners to find good,current information on how to get started. This guide aims to provideexactly that, whilst staying updated with the latest stable version ofnode.js.

    This guide has been updated to reflect the latest changes in node 0.4.x,the currently stable branch of node.js.

    Learning JavaScript

    This guide assumes that you are already familar with JavaScript. If youare not, you should go ahead and read:Eloquent JavaScript, a freeonline book byMarijn Haverbeke.

    Hello World Tutorial

    This tutorial guides you through installing node.js, including thecreation of a simple hello world http server.

    http://nodeguide.com/index.htmlhttp://nodeguide.com/index.htmlhttp://nodeguide.com/beginner.html#learning-javascripthttp://nodeguide.com/beginner.html#learning-javascripthttp://nodeguide.com/beginner.html#hello-world-tutorialhttp://nodeguide.com/beginner.html#hello-world-tutorialhttp://nodeguide.com/beginner.html#installationhttp://nodeguide.com/beginner.html#installationhttp://nodeguide.com/beginner.html#the-interactive-node.js-shellhttp://nodeguide.com/beginner.html#the-interactive-node.js-shellhttp://nodeguide.com/beginner.html#your-first-programhttp://nodeguide.com/beginner.html#your-first-programhttp://nodeguide.com/beginner.html#a-hello-world-http-serverhttp://nodeguide.com/beginner.html#a-hello-world-http-serverhttp://nodeguide.com/beginner.html#the-module-systemhttp://nodeguide.com/beginner.html#the-module-systemhttp://nodeguide.com/beginner.html#using-eventemittershttp://nodeguide.com/beginner.html#using-eventemittershttp://nodeguide.com/beginner.html#next-stepshttp://nodeguide.com/beginner.html#next-stepshttp://nodeguide.com/beginner.html#debugging-node.js-appshttp://nodeguide.com/beginner.html#debugging-node.js-appshttp://nodeguide.com/beginner.html#using-console.loghttp://nodeguide.com/beginner.html#using-console.loghttp://nodeguide.com/beginner.html#using-the-node-debuggerhttp://nodeguide.com/beginner.html#using-the-node-debuggerhttp://nodeguide.com/beginner.html#using-the-webkit-inspectorhttp://nodeguide.com/beginner.html#using-the-webkit-inspectorhttp://nodeguide.com/beginner.html#frameworkshttp://nodeguide.com/beginner.html#frameworkshttp://nodeguide.com/beginner.html#expresshttp://nodeguide.com/beginner.html#expresshttp://nodeguide.com/beginner.html#fab.jshttp://nodeguide.com/beginner.html#fab.jshttp://nodeguide.com/beginner.html#hosting-deploymenthttp://nodeguide.com/beginner.html#hosting-deploymenthttp://nodeguide.com/beginner.html#quick-dirty-deploymenthttp://nodeguide.com/beginner.html#quick-dirty-deploymenthttp://nodeguide.com/beginner.html#joyent-no.dehttp://nodeguide.com/beginner.html#joyent-no.dehttp://nodeguide.com/beginner.html#TOChttp://eloquentjavascript.net/http://eloquentjavascript.net/http://eloquentjavascript.net/http://twitter.com/marijnjhhttp://twitter.com/marijnjhhttp://twitter.com/marijnjhhttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://twitter.com/marijnjhhttp://eloquentjavascript.net/http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#joyent-no.dehttp://nodeguide.com/beginner.html#quick-dirty-deploymenthttp://nodeguide.com/beginner.html#hosting-deploymenthttp://nodeguide.com/beginner.html#fab.jshttp://nodeguide.com/beginner.html#expresshttp://nodeguide.com/beginner.html#frameworkshttp://nodeguide.com/beginner.html#using-the-webkit-inspectorhttp://nodeguide.com/beginner.html#using-the-node-debuggerhttp://nodeguide.com/beginner.html#using-console.loghttp://nodeguide.com/beginner.html#debugging-node.js-appshttp://nodeguide.com/beginner.html#next-stepshttp://nodeguide.com/beginner.html#using-eventemittershttp://nodeguide.com/beginner.html#the-module-systemhttp://nodeguide.com/beginner.html#a-hello-world-http-serverhttp://nodeguide.com/beginner.html#your-first-programhttp://nodeguide.com/beginner.html#the-interactive-node.js-shellhttp://nodeguide.com/beginner.html#installationhttp://nodeguide.com/beginner.html#hello-world-tutorialhttp://nodeguide.com/beginner.html#learning-javascripthttp://nodeguide.com/index.html
  • 8/3/2019 NodeJS Felix

    4/31

    Installation

    First of all: You should run a *nix operating system in order to usenode.js at this point. Linux and OSX are recommended, but you shouldalso be able to use FreeBSD and cygwin (on windows). A full windows

    port of node.js is in the works, but it is not yet ready for public usage.

    The most common way to install node.js is to directly compile it fromthe downloaded source code. There are also various packages availablefor different package managers, but since their update frequency

    varies, I recommend installing from source.

    You can get the latest source code fromnodejs.org. Use the commandsbelow to download and install v0.4.4:

    $ wget http://nodejs.org/dist/node-v0.4.4.tar.gz$ tar -xzf node-v0.4.4.tar.gz$ cd node-v0.4.4.tar.gz$ ./configure$ sudo make install

    Node.js itself has no external dependencies except common build toolsas well as pythons for the build system itself. On OSX you must installXCode for this to work, and on Ubuntu you probably have to run:

    $ apt-get -y install build-essential

    The interactive node.js shell

    If everything worked, you should be able to invoke the interactivenode.js shell like this:

    $ node> console.log('Hello World');Hello World

    The interactive shell (also calledREPL) is a great place to test simple

    one liners, and can also be directlyembeddedinto your node.jsapplications. In order to get out of it, simply press Ctrl + C.

    The REPL also comes with many other great features, mostimportantly tab auto-completion.

    Your first program

    Writing a node.js program is as simple as creating a new file with a '.js'extension. For example you could create a simple 'hello_world.js' file

    with the following content:

    http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodejs.org/http://nodejs.org/http://nodejs.org/http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://en.wikipedia.org/wiki/REPLhttp://en.wikipedia.org/wiki/REPLhttp://en.wikipedia.org/wiki/REPLhttp://nodejs.org/docs/v0.4.4/api/repl.htmlhttp://nodejs.org/docs/v0.4.4/api/repl.htmlhttp://nodejs.org/docs/v0.4.4/api/repl.htmlhttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodejs.org/docs/v0.4.4/api/repl.htmlhttp://en.wikipedia.org/wiki/REPLhttp://nodeguide.com/beginner.html#TOChttp://nodejs.org/http://nodeguide.com/beginner.html#TOC
  • 8/3/2019 NodeJS Felix

    5/31

    console.log('Hello World');

    After you have saved the file, you can execute it from your terminal likeso:

    $ node hello.jsHello World

    A hello world http server

    Now printing hello world to a terminal isn't all that exciting. Let's takethe next step and write a program that responds to hello world via http.

    We'll call the file 'hello_http.js' and put the following code into it:

    var http = require('http');

    var server = http.createServer(function(req, res) {res.writeHead(200);res.end('Hello Http');

    });server.listen(8080);

    Now lets run this program from the terminal by typing:

    $ node hello_http.js

    The first thing you'll notice is that this program, unlike our first one,doesn't exit right away. That's because a node program will always run

    until it's certain that no further events are possible. In this case theopen http server is the source of events that will keep things going.

    Testing the server is as simple as opening a new browser tab, andnavigating to the following url:http://localhost:8080/. As expected,

    you should see a response that reads: 'Hello Http'.

    Alternatively, you could also open up a new terminal and use curl totest your server:

    $ curl localhost:8080Hello Http

    Now let's have a closer look at the steps involved in our little program.In the first line, we include the http core module and assign it to a

    variable called http. You will find more information on this in the nextsection about the module system.

    Next we create a variable called server by calling http.createServer. Theargument passed into this call is a closure that is called whenever an

    http request comes in.

    http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://localhost:8080/http://localhost:8080/http://localhost:8080/http://localhost:8080/http://nodeguide.com/beginner.html#TOC
  • 8/3/2019 NodeJS Felix

    6/31

    Finally we call server.listen(8080) to tell node.js the port on which wewant our server to run. If you want to run on port 80, your programneeds to be executed as root.

    Now when you point your browser to 'localhost:8080', the connectionclosure is invoked with a req and res object. Thereq is a readable streamthat emits 'data' events for each incoming piece of data (like a formsubmission or file upload). The res object is a writable stream that isused to send data back to the client. In our case we are simply sendinga 200 OK header, as well as the body 'Hello Http'.

    The module system

    In order to structure your program into different files, node.js provides

    you with a simple module system.

    To illustrate the approach, let's create a new file called 'main.js' withthe following content:

    var hello = require('./hello');hello.world();

    As you have probably guessed, the require('./hello') is used to importthe contents from another JavaScript file. The initial './' indicates thatthe file is located in the same directory 'main.js'. Also note that youdon't have to provide the file extension, as '.js' is assumed by default.

    So let's go ahead and create our 'hello.js' file, with the followingcontent:

    exports.world = function() {console.log('Hello World');

    }

    What you notice here, is that we are assigning a property called 'world'

    to an object called 'exports'. Such an 'exports' object is available inevery module, and it is returned whenever the require function is usedto include the module. If we now go ahead and run our 'main.js'program, we will see the expected output:

    $ node main.jsHello World

    At this point it should also be mentioned that many node users areoverwriting the exports object directly like so:

    http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOC
  • 8/3/2019 NodeJS Felix

    7/31

    module.exports = function() {

    // ...}

    As you might have expected, this will directly cause the require function

    to return the assigned function. This is useful if you're doingobjectoriented programming, where each file exports the constructor of oneclass.

    The next thing you need to know about the module system is how itdeals with require calls that don't include a relative hint about thelocation of the included file. Take for example:

    var http = require('http');

    What node.js will do in this case, is to first look if there is a coremodule named http, and since that's the case, return that directly. But

    what about non-core modules, such as 'mysql'?

    var mysql = require('mysql');

    In this case node.js will walk up the directory tree, moving througheach parent directory in turn, checking in each to see if there is a foldercalled 'node_modules'. If such a folder is found, node.js will look intothis folder for a file called 'mysql.js'. If no matching file is found andthe directory root '/' is reached, node.js will give up and throw an

    exception.

    At this point node.js also considers an additional, mutable list ofalternative include directories which are accessible throughthe require.paths array. However, there is intense debate aboutremoving this feature, so you are probably better off ignoring it.

    Last but not least, node.js also lets you create an 'index.js' file, whichindicates the main include file for a directory. So if youcall require('./foo') , both a 'foo.js' file as well as an 'foo/index.js' file

    will be considered, this goes for non-relative includes as well.

    Using EventEmitters

    Node.js implements theobserver patternusing a class calledEventEmitter. Whenever there is an object that represents the sourceof several kinds of events, node.js usually makes the underlaying classinherit from EventEmitter.

    Using EventEmitter's is pretty straight-forward. You can listen to aspecific event by calling the 'on()' function on your object, providing

    http://nodeguide.com/object_oriented_programming.htmlhttp://nodeguide.com/object_oriented_programming.htmlhttp://nodeguide.com/object_oriented_programming.htmlhttp://nodeguide.com/object_oriented_programming.htmlhttp://nodeguide.com/beginner.html#TOChttp://en.wikipedia.org/wiki/Observer_patternhttp://en.wikipedia.org/wiki/Observer_patternhttp://en.wikipedia.org/wiki/Observer_patternhttp://en.wikipedia.org/wiki/Observer_patternhttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/object_oriented_programming.htmlhttp://nodeguide.com/object_oriented_programming.html
  • 8/3/2019 NodeJS Felix

    8/31

    the name of the event, as well as a callback closure as the parameters.For example:

    var data = '';req

    .on('data',function

    (chunk) {data += chunk;}).on('end', function() {

    console.log('POST data: %s', data);})

    As you can see, the on() function also returns a reference to the object itbelongs to, allowing you to chain several of such event listeners.

    If you're only interested in the first occurrence of an event, you can usethe once() function instead.

    Finally, you can remove event listeners by usingthe removeListener function. Please note that the argument to thisfunction is a reference to the callback you are trying to remove, not thename of the event:

    var onData = function(chunk) {console.log(chunk);req.removeListener(onData);

    }

    req.on('data', onData);

    The example above is essentially identical to the once() function.

    Next Steps

    Now that you know your node.js basics, you're probably best off bywriting a few little programs yourself. The best place to start outisnode's api documentation, using it as a source of inspiration forsomething you want to play with.

    Debugging node.js apps

    There are many ways to debug your node.js based applications.Personally I prefer to do as little debugging as possible, so I strictlyfollow the advice of thetest driven development guide.

    However, if you find yourself in a situation where you need to locate atricky bug in an existing applications, here are a few approaches that

    can help.

    http://nodeguide.com/beginner.html#TOChttp://nodejs.org/docs/v0.4.4/api/http://nodejs.org/docs/v0.4.4/api/http://nodejs.org/docs/v0.4.4/api/http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/test_driven_development.htmlhttp://nodeguide.com/test_driven_development.htmlhttp://nodeguide.com/test_driven_development.htmlhttp://nodeguide.com/test_driven_development.htmlhttp://nodeguide.com/beginner.html#TOChttp://nodejs.org/docs/v0.4.4/api/http://nodeguide.com/beginner.html#TOC
  • 8/3/2019 NodeJS Felix

    9/31

    Using console.log()

    The easiest way to understand a problem is by inspecting objects usingconsole.log(). You can either directly pass in objects as parameters:

    var foo = {bar: 'foobar'};console.log(foo);

    Or you can use its sprintf()-like capabilities to format your debugoutput:

    var foo = {bar: 'foobar'};console.log('Hello %s, this is my object: %j', 'World', foo);

    Using the node debugger

    If console.log() isn't your thing, or you think your problem can bebetter analyzed using breakpoints, the node's built-in debugger is agreat choice. You can invoke the debugger by simply calling:

    $ node.js debug my_file.js

    Work in progress, please come back later ...

    Using the WebKit Inspector

    Work in progress, please come back later ...

    Frameworks

    If you're new to node.js, you might not want to re-invent the wheelwhen it comes to parsing POST requests, routing urls or renderingviews. In this case, you probably want to use one of the popular webframeworks. This section gives you a quick overview over the popularchoices, and my opinionated take on them.

    Express

    At this pointexpressis probably the go-to framework for most node.jsdevelopers. It's relatively mature, and includes theconnect(think rack)middleware layer. Included in the package are routing, configuration, atemplate engine, POST parsing and many other features.

    While express is a solid framework, it's currently addressing a muchsmaller scope than fullstack frameworks like Rails, CakePHP orDjango. It's more comparable to Sinatra, and unfortunately doesn't

    really make a big effort to differentiate itself from its Ruby roots into

    http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://expressjs.com/http://expressjs.com/http://expressjs.com/https://github.com/senchalabs/connecthttps://github.com/senchalabs/connecthttps://github.com/senchalabs/connecthttp://expressjs.com/http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOC
  • 8/3/2019 NodeJS Felix

    10/31

    something that feels natural in JavaScript. Anyhow, short of writingyour own framework, it's certainly a great choice at this point.

    fab.js

    You think you know JavaScript? Think again. Originally inspired byjQuery's chaining,fab.jshas taken a very unconventional approach oftwisting JavaScript beyond most peoples brain capacity. Each functionreturns another function, eliminating the need for method namesaltogether, while giving the resulting code a lisp-esque look & feel.

    At this point I don't consider fab.js production-ready, but if you're stillexploring the world of node.js, you should absolutely try it out at leastonce. If nothing else, fab.js shows the world that JavaScript doesn'thave to copy Ruby, Python or PHP when it comes to web frameworks,and can go its own unique ways.

    Hosting & Deployment

    Quick & Dirty Deployment

    If you have just written your first node.js application, and you want toget it running as fast as possible, this is how to do it:

    1.

    Copy your program to the server you want to run it on. If you'reusing git, this probably just means to clone the repository fromanother server or service likeGitHub.

    2.Assuming your project contains a 'server.js' file, navigate to thedirectory containing it, then type:

    3. $ screen4. $ node server.js

    This invokes your 'server.js' program inside a so called screen session.Screen is a tool that provides you with a shell that remains its state,even when you close the terminal app you used to login to your server.

    So you can now safely close your terminal app, and your 'server.js' willcontinue running. If you want to monitor it, you can log into yourserver again, and type:

    $ screen -r

    This will reconnect you to the backgrounded shell running yourprogram.

    However, this approach is only recommended for experimentaldeployments. If your node applications crashes at some point, screen

    http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://fabjs.org/http://fabjs.org/http://fabjs.org/http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://github.com/http://github.com/http://github.com/http://github.com/http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://fabjs.org/http://nodeguide.com/beginner.html#TOC
  • 8/3/2019 NodeJS Felix

    11/31

    will not try to restart it, so don't use this method for productionapplications.

    Joyent no.de

    Work in progress, please come back later ...

    2011, Debuggable Limited.

    http://nodeguide.com/beginner.html#TOChttp://nodeguide.com/beginner.html#TOChttp://debuggable.com/http://debuggable.com/http://debuggable.com/http://debuggable.com/http://nodeguide.com/beginner.html#TOC
  • 8/3/2019 NodeJS Felix

    12/31

    Home / All Guides

    Felix's Node.js Style Guide

    Tabs vs Spaces Semicolons Editors Trailing whitespace Line length Quotes Braces Variable declarations Variable and property names Class names Constants Object / Array creation Equality operator Extending prototypes Conditions Function length Return statements Named closures Nested Closures Callbacks Object.freeze, Object.preventExtensions, Object.seal, with, eval Getters and setters EventEmitters Inheritance / Object oriented programming

    There is no official document that governs the style of node.jsapplications. This guide is my opinionated attempt to bring you a goodset of instructions that will allow you to create beautiful and consistentsoftware.

    This guide assumes that you are only targeting node.js. If your codealso needs to run in the browser or other environments, please ignoresome of it.

    Please also note that node.js, as well as various packages for it, havetheir own slightly different styles. So if you're interested in contributingto those, play by their rules.

    Tabs vs Spaces

    http://nodeguide.com/index.htmlhttp://nodeguide.com/index.htmlhttp://nodeguide.com/style.html#tabs-vs-spaceshttp://nodeguide.com/style.html#tabs-vs-spaceshttp://nodeguide.com/style.html#semicolonshttp://nodeguide.com/style.html#semicolonshttp://nodeguide.com/style.html#editorshttp://nodeguide.com/style.html#editorshttp://nodeguide.com/style.html#trailing-whitespacehttp://nodeguide.com/style.html#trailing-whitespacehttp://nodeguide.com/style.html#line-lengthhttp://nodeguide.com/style.html#line-lengthhttp://nodeguide.com/style.html#quoteshttp://nodeguide.com/style.html#quoteshttp://nodeguide.com/style.html#braceshttp://nodeguide.com/style.html#braceshttp://nodeguide.com/style.html#variable-declarationshttp://nodeguide.com/style.html#variable-declarationshttp://nodeguide.com/style.html#variable-and-property-nameshttp://nodeguide.com/style.html#variable-and-property-nameshttp://nodeguide.com/style.html#class-nameshttp://nodeguide.com/style.html#class-nameshttp://nodeguide.com/style.html#constantshttp://nodeguide.com/style.html#constantshttp://nodeguide.com/style.html#object-array-creationhttp://nodeguide.com/style.html#object-array-creationhttp://nodeguide.com/style.html#equality-operatorhttp://nodeguide.com/style.html#equality-operatorhttp://nodeguide.com/style.html#extending-prototypeshttp://nodeguide.com/style.html#extending-prototypeshttp://nodeguide.com/style.html#conditionshttp://nodeguide.com/style.html#conditionshttp://nodeguide.com/style.html#function-lengthhttp://nodeguide.com/style.html#function-lengthhttp://nodeguide.com/style.html#return-statementshttp://nodeguide.com/style.html#return-statementshttp://nodeguide.com/style.html#named-closureshttp://nodeguide.com/style.html#named-closureshttp://nodeguide.com/style.html#nested-closureshttp://nodeguide.com/style.html#nested-closureshttp://nodeguide.com/style.html#callbackshttp://nodeguide.com/style.html#callbackshttp://nodeguide.com/style.html#object.freeze-object.preventextensions-object.seal-with-evalhttp://nodeguide.com/style.html#object.freeze-object.preventextensions-object.seal-with-evalhttp://nodeguide.com/style.html#getters-and-settershttp://nodeguide.com/style.html#getters-and-settershttp://nodeguide.com/style.html#eventemittershttp://nodeguide.com/style.html#eventemittershttp://nodeguide.com/style.html#inheritance-object-oriented-programminghttp://nodeguide.com/style.html#inheritance-object-oriented-programminghttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#inheritance-object-oriented-programminghttp://nodeguide.com/style.html#eventemittershttp://nodeguide.com/style.html#getters-and-settershttp://nodeguide.com/style.html#object.freeze-object.preventextensions-object.seal-with-evalhttp://nodeguide.com/style.html#callbackshttp://nodeguide.com/style.html#nested-closureshttp://nodeguide.com/style.html#named-closureshttp://nodeguide.com/style.html#return-statementshttp://nodeguide.com/style.html#function-lengthhttp://nodeguide.com/style.html#conditionshttp://nodeguide.com/style.html#extending-prototypeshttp://nodeguide.com/style.html#equality-operatorhttp://nodeguide.com/style.html#object-array-creationhttp://nodeguide.com/style.html#constantshttp://nodeguide.com/style.html#class-nameshttp://nodeguide.com/style.html#variable-and-property-nameshttp://nodeguide.com/style.html#variable-declarationshttp://nodeguide.com/style.html#braceshttp://nodeguide.com/style.html#quoteshttp://nodeguide.com/style.html#line-lengthhttp://nodeguide.com/style.html#trailing-whitespacehttp://nodeguide.com/style.html#editorshttp://nodeguide.com/style.html#semicolonshttp://nodeguide.com/style.html#tabs-vs-spaceshttp://nodeguide.com/index.html
  • 8/3/2019 NodeJS Felix

    13/31

    Let's start with the religious problems first. Ourbenevolentdictatorhas chosen 2 space indention for the node core, so you woulddo well to follow his choice.

    SemicolonsThere arerebellious forcesthat try to steal your semicolons from

    you. But make no mistake, our traditional culture is stillwell and trulyalive. So follow the community, and use those semicolons!

    Editors

    You can use any editor. However, having support for JS syntaxhighlighting and executing the currently open file with node.js will

    come in very handy. Whilevimmay not help you to impress the ladies,it will please ourBDFLand your grandpa will also approve.

    I'm typing this document in Notes on my iPad, but that's because I'mon a beach in Thailand. It's likely that your own work environment willimpact your choice of editor as well.

    Trailing whitespace

    Just like you brush your teeth after every meal, you clean up anytrailing whitespace in your JavaScript files before committing.Otherwise the rotten smell of careless neglect will eventually driveaway contributors and/or co-workers.

    Line length

    Limit your lines to 80 characters. Yes, screens have gotten much biggerover the last few years, but your brain hasn't. Use the additional roomfor split screen, your editor supports that, right?

    Quotes

    Use single quotes, unless you are writing JSON.

    Right:

    var foo = 'bar';

    Wrong:

    var foo = "bar";

    http://nodeguide.com/style.html#TOChttp://nodeguide.com/community.html#ryan-dahlhttp://nodeguide.com/community.html#ryan-dahlhttp://nodeguide.com/community.html#ryan-dahlhttp://nodeguide.com/community.html#ryan-dahlhttp://nodeguide.com/style.html#TOChttp://nodeguide.com/community.html#isaac-schlueterhttp://nodeguide.com/community.html#isaac-schlueterhttp://nodeguide.com/community.html#isaac-schlueterhttp://news.ycombinator.com/item?id=1547647http://news.ycombinator.com/item?id=1547647http://news.ycombinator.com/item?id=1547647http://news.ycombinator.com/item?id=1547647http://nodeguide.com/style.html#TOChttp://www.vim.org/http://www.vim.org/http://www.vim.org/http://en.wikipedia.org/wiki/BDFLhttp://en.wikipedia.org/wiki/BDFLhttp://en.wikipedia.org/wiki/BDFLhttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://en.wikipedia.org/wiki/BDFLhttp://www.vim.org/http://nodeguide.com/style.html#TOChttp://news.ycombinator.com/item?id=1547647http://news.ycombinator.com/item?id=1547647http://nodeguide.com/community.html#isaac-schlueterhttp://nodeguide.com/style.html#TOChttp://nodeguide.com/community.html#ryan-dahlhttp://nodeguide.com/community.html#ryan-dahl
  • 8/3/2019 NodeJS Felix

    14/31

    Braces

    Your opening braces go on the same line as the statement.

    Right:if (true) {

    console.log('winning');}

    Wrong:

    if (true){

    console.log('losing');}

    Also, notice the use of whitespace before and after the conditionstatement.

    Variable declarations

    Declare one variable per var statement, it makes it easier to re-orderthe lines. IgnoreCrockfordon this, and put those declarations

    wherever they make sense.

    Right:

    var keys = ['foo', 'bar'];var values = [23, 42];

    var object = {};while (items.length) {

    var key = keys.pop();object[key] = values.pop();

    }

    Wrong:

    var keys = ['foo', 'bar'],values = [23, 42],object = {},key;

    while (items.length) {key = keys.pop();object[key] = values.pop();

    }

    Variable and property names

    http://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://javascript.crockford.com/code.htmlhttp://javascript.crockford.com/code.htmlhttp://javascript.crockford.com/code.htmlhttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://javascript.crockford.com/code.htmlhttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOC
  • 8/3/2019 NodeJS Felix

    15/31

    Variables and properties should uselower camel casecapitalization.They should also be descriptive. Single character variables anduncommon abbreviations should generally be avoided.

    Right:

    var adminUser = db.query('SELECT * FROM users ...');

    Wrong:

    var admin_user = d.query('SELECT * FROM users ...');

    Class names

    Class names should be capitalized usingupper camel case.

    Right:

    function BankAccount() {}

    Wrong:

    function bank_Account() {}

    Constants

    Constants should be declared as regular variables or static classproperties, using all uppercase letters.

    Node.js / V8 actually supports mozilla'sconstextension, butunfortunately that cannot be applied to class members, nor is it part ofany ECMA standard.

    Right:

    var SECOND = 1 * 1000;

    function File() {}File.FULL_PERMISSIONS = 0777;

    Wrong:

    const SECOND = 1 * 1000;

    function File() {

    }File.fullPermissions = 0777;

    http://nodeguide.com/style.html#TOChttp://en.wikipedia.org/wiki/camelCase#Variations_and_synonymshttp://en.wikipedia.org/wiki/camelCase#Variations_and_synonymshttp://en.wikipedia.org/wiki/camelCase#Variations_and_synonymshttp://nodeguide.com/style.html#TOChttp://en.wikipedia.org/wiki/camelCase#Variations_and_synonymshttp://en.wikipedia.org/wiki/camelCase#Variations_and_synonymshttp://en.wikipedia.org/wiki/camelCase#Variations_and_synonymshttp://nodeguide.com/style.html#TOChttps://developer.mozilla.org/en/JavaScript/Reference/Statements/consthttps://developer.mozilla.org/en/JavaScript/Reference/Statements/consthttps://developer.mozilla.org/en/JavaScript/Reference/Statements/consthttps://developer.mozilla.org/en/JavaScript/Reference/Statements/consthttp://nodeguide.com/style.html#TOChttp://en.wikipedia.org/wiki/camelCase#Variations_and_synonymshttp://nodeguide.com/style.html#TOChttp://en.wikipedia.org/wiki/camelCase#Variations_and_synonyms
  • 8/3/2019 NodeJS Felix

    16/31

    Object / Array creation

    Use trailing commas and put shortdeclarations on a single line. Onlyquote keys when your interpreter complains:

    Right:

    var a = ['hello', 'world'];var b = {

    good: 'code','is generally': 'pretty',

    };

    Wrong:

    var a = [

    'hello', 'world'];var b = {"good": 'code'

    , is generally: 'pretty'};

    Equality operator

    Programming is not about rememberingstupid rules. Use the tripleequality operator as it will work just as expected.

    Right:

    var a = 0;if (a === '') {

    console.log('winning');}

    Wrong:

    var a = 0;if (a == '') {

    console.log('losing');

    }

    Extending prototypes

    Do not extend the prototypes of any objects, especially native ones.There is a special place in hell waiting for you if you don't obey thisrule.

    Right:

    var a = [];if (!a.length) {

    http://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttps://developer.mozilla.org/en/JavaScript/Reference/Operators/Comparison_Operatorshttps://developer.mozilla.org/en/JavaScript/Reference/Operators/Comparison_Operatorshttps://developer.mozilla.org/en/JavaScript/Reference/Operators/Comparison_Operatorshttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttps://developer.mozilla.org/en/JavaScript/Reference/Operators/Comparison_Operatorshttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOC
  • 8/3/2019 NodeJS Felix

    17/31

    console.log('winning');}

    Wrong:

    Array.prototype.empty = function() {return !this.length;

    }

    var a = [];if (a.empty()) {

    console.log('losing');}

    Conditions

    Any non-trivial conditions should be assigned to a descriptive variable:

    Right:

    var isAuthorized = (user.isAdmin() || user.isModerator());if (isAuthorized) {

    console.log('winning');}

    Wrong:

    if (user.isAdmin() || user.isModerator()) {console.log('losing');

    }

    Function length

    Keep your functions short. A good function fits on a slide that thepeople in the last row of a big room can comfortably read. So don'tcount on them having perfect vision and limit yourself to ~10 lines ofcode per function.

    Return statementsTo avoid deep nesting of if-statements, always return a functions valueas early as possible.

    Right:

    function isPercentage(val) {if (val < 0) {

    return false;}

    if (val > 100) {return false;

    http://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOC
  • 8/3/2019 NodeJS Felix

    18/31

    }

    return true;}

    Wrong:

    function isPercentage(val) {if (val >= 0) {

    if (val < 100) {return true;

    } else {return false;

    }} else {

    return false;}

    }

    Or for this particular example it may also be fine to shorten things evenfurther:

    function isPercentage(val) {var isInRange = (val >= 0 && val

  • 8/3/2019 NodeJS Felix

    19/31

    }, 1000);

    function afterConnect() {console.log('winning');

    }

    Wrong:

    setTimeout(function() {client.connect(function() {

    console.log('losing');});

    }, 1000);

    Callbacks

    Since node is all about non-blocking I/O, functions generally return

    their results using callbacks. The convention used by the node core is toreserve the first parameter of any callback for an optional error object.

    You should use the same approach for your own callbacks.

    Object.freeze, Object.preventExtensions,Object.seal, with, eval

    Crazy shit that you will probably never need. Stay away from it.

    Getters and setters

    Do not use setters, they cause more problems for people who try to useyour software than they can solve.

    Feel free to use getters that are free fromside effects, like providing alength property for a collection class.

    EventEmitters

    Node.js ships with a simple EventEmitter class that can be includedfrom the 'events' module:

    var EventEmitter = require('events').EventEmitter;

    When creating complex classes, it is common to inherit from thisEventEmitter class to emit events. This is basically a simpleimplementation of theObserver pattern.

    However, I strongly recommend that you never listen to the events ofyour own class from within it. It isn't natural for an object to observe

    http://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://en.wikipedia.org/wiki/Side_effect_(computer_science)http://en.wikipedia.org/wiki/Side_effect_(computer_science)http://en.wikipedia.org/wiki/Side_effect_(computer_science)http://nodeguide.com/style.html#TOChttp://en.wikipedia.org/wiki/Observer_patternhttp://en.wikipedia.org/wiki/Observer_patternhttp://en.wikipedia.org/wiki/Observer_patternhttp://en.wikipedia.org/wiki/Observer_patternhttp://nodeguide.com/style.html#TOChttp://en.wikipedia.org/wiki/Side_effect_(computer_science)http://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOChttp://nodeguide.com/style.html#TOC
  • 8/3/2019 NodeJS Felix

    20/31

    itself. It often leads to undesirable exposure to implementation details,and makes your code more difficult to follow.

    Inheritance / Object oriented programming

    Inheritance and object oriented programming are subjects bythemselves. If you're interested in following this popular programmingmodel, please read myObject oriented programming guide.

    2011, Debuggable Limited.

    http://nodeguide.com/style.html#TOChttp://nodeguide.com/object_oriented_programming.htmlhttp://nodeguide.com/object_oriented_programming.htmlhttp://nodeguide.com/object_oriented_programming.htmlhttp://debuggable.com/http://debuggable.com/http://debuggable.com/http://debuggable.com/http://nodeguide.com/object_oriented_programming.htmlhttp://nodeguide.com/style.html#TOC
  • 8/3/2019 NodeJS Felix

    21/31

    Home / All Guides

    Felix's Node.js Community Guide

    IRC Google Groups Twitter Community Members

    o Ryan Dahlo Isaac Schluetero Bert Beldero TJ Holowaychuko Tim Caswello Felix Geisendrfero Mikeal Rogerso Alexis Selliero Jeremy Ashkenaso Jed Schmidto Marak Squireso Peteris Kruminso James Hallidayo Your name here

    If you have just read the Beginner's Guide, and you are interested inbecoming more involved with the node.js community, this guide is foryou.

    IRC

    IRC is a great place to discuss the virtues of vim vs. emacs, as well asgetting support and interaction from people within the node.jscommunity.

    The official irc channel for node.js is located onchat.freenode.netandnamed '#node.js' (yes, the dot is part of the name). There are usually~500 people in there these days.

    If you have a question, just go ahead and ask it. Depending on who'sawake and paying attention, you often get great replies right away.Otherwise just stick around and wait for an hour or so. After that it's okto ask your question again, in case you think it went by unnoticed.

    http://nodeguide.com/index.htmlhttp://nodeguide.com/index.htmlhttp://nodeguide.com/community.html#irchttp://nodeguide.com/community.html#irchttp://nodeguide.com/community.html#google-groupshttp://nodeguide.com/community.html#google-groupshttp://nodeguide.com/community.html#twitterhttp://nodeguide.com/community.html#twitterhttp://nodeguide.com/community.html#community-membershttp://nodeguide.com/community.html#community-membershttp://nodeguide.com/community.html#ryan-dahlhttp://nodeguide.com/community.html#ryan-dahlhttp://nodeguide.com/community.html#isaac-schlueterhttp://nodeguide.com/community.html#isaac-schlueterhttp://nodeguide.com/community.html#bert-belderhttp://nodeguide.com/community.html#bert-belderhttp://nodeguide.com/community.html#tj-holowaychukhttp://nodeguide.com/community.html#tj-holowaychukhttp://nodeguide.com/community.html#tim-caswellhttp://nodeguide.com/community.html#tim-caswellhttp://nodeguide.com/community.html#felix-geisend%C3%B6rferhttp://nodeguide.com/community.html#felix-geisend%C3%B6rferhttp://nodeguide.com/community.html#mikeal-rogershttp://nodeguide.com/community.html#mikeal-rogershttp://nodeguide.com/community.html#alexis-sellierhttp://nodeguide.com/community.html#alexis-sellierhttp://nodeguide.com/community.html#jeremy-ashkenashttp://nodeguide.com/community.html#jeremy-ashkenashttp://nodeguide.com/community.html#jed-schmidthttp://nodeguide.com/community.html#jed-schmidthttp://nodeguide.com/community.html#marak-squireshttp://nodeguide.com/community.html#marak-squireshttp://nodeguide.com/community.html#peteris-kruminshttp://nodeguide.com/community.html#peteris-kruminshttp://nodeguide.com/community.html#james-hallidayhttp://nodeguide.com/community.html#james-hallidayhttp://nodeguide.com/community.html#your-name-herehttp://nodeguide.com/community.html#your-name-herehttp://nodeguide.com/community.html#TOChttp://webchat.freenode.net/http://webchat.freenode.net/http://webchat.freenode.net/http://webchat.freenode.net/http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#your-name-herehttp://nodeguide.com/community.html#james-hallidayhttp://nodeguide.com/community.html#peteris-kruminshttp://nodeguide.com/community.html#marak-squireshttp://nodeguide.com/community.html#jed-schmidthttp://nodeguide.com/community.html#jeremy-ashkenashttp://nodeguide.com/community.html#alexis-sellierhttp://nodeguide.com/community.html#mikeal-rogershttp://nodeguide.com/community.html#felix-geisend%C3%B6rferhttp://nodeguide.com/community.html#tim-caswellhttp://nodeguide.com/community.html#tj-holowaychukhttp://nodeguide.com/community.html#bert-belderhttp://nodeguide.com/community.html#isaac-schlueterhttp://nodeguide.com/community.html#ryan-dahlhttp://nodeguide.com/community.html#community-membershttp://nodeguide.com/community.html#twitterhttp://nodeguide.com/community.html#google-groupshttp://nodeguide.com/community.html#irchttp://nodeguide.com/index.html
  • 8/3/2019 NodeJS Felix

    22/31

    Oh, and you should always try to find your answer on the web first, butyouknow that, right?

    Google Groups

    A lot of discussion around node.js takes place via google group mailinglists. The two official lists are:

    nodejs

    The 'nodejs' list is meant for general node.js questions and

    discussions. So generally that's the one you want to use.

    nodejs-dev

    If you have found a bug in node.js, or want to get involved in

    discussing features & development, feel free to participate in the

    'nodejs-dev' mailing list. It's generally less noisy, and most of the

    core contributors follow it.

    Twitter

    Since twitter cuts off tag names when it sees a dot character, manypeople use the tag '#nodejs' to highlight node.js related content ontwitter. You can find the current stream of tweets via twitter's searchfunction:

    http://search.twitter.com/search?q=%23nodejs%20OR%20node.js

    Since not everybody is tagging their content, the above query alsoincludes results for the term 'node.js' itself.

    Community Members

    If you are curious about the people driving the node.js development &ecosystem, here is a list of a few people whose names you should know.

    Ryan Dahl

    Ryan is the creator, maintainer andBDFLof node.js. This means anycommits that go into node.js are reviewed by him, and he's the only one

    who directly pushes to the node repository.

    While Ryan will generally try to respond to questions on the mailinglist and IRC, he's a very busy guy. So don't be upset if he doesn't answer

    http://lmgtfy.com/http://lmgtfy.com/http://lmgtfy.com/http://nodeguide.com/community.html#TOChttps://groups.google.com/forum/#!forum/nodejshttps://groups.google.com/forum/#!forum/nodejshttps://groups.google.com/forum/#!forum/nodejs-devhttps://groups.google.com/forum/#!forum/nodejs-devhttp://nodeguide.com/community.html#TOChttp://search.twitter.com/search?q=%23nodejs%20OR%20node.jshttp://search.twitter.com/search?q=%23nodejs%20OR%20node.jshttp://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttp://en.wikipedia.org/wiki/BDFLhttp://en.wikipedia.org/wiki/BDFLhttp://en.wikipedia.org/wiki/BDFLhttp://en.wikipedia.org/wiki/BDFLhttp://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttp://search.twitter.com/search?q=%23nodejs%20OR%20node.jshttp://nodeguide.com/community.html#TOChttps://groups.google.com/forum/#!forum/nodejs-devhttps://groups.google.com/forum/#!forum/nodejshttp://nodeguide.com/community.html#TOChttp://lmgtfy.com/
  • 8/3/2019 NodeJS Felix

    23/31

    your direct questions right away, there are usually other people aroundwho can help as well.

    Ryan is currently working forJoyent, a company that provides greatheroku-stylenode.js hosting, and is the official corporate sponsor fornode.js.

    IRC Nick: ryah Twitter:@ryah GitHub:ry Blog:blog.nodejs.org Where: San Fransico, USA

    Isaac Schlueter

    Isaac is the author ofnpm, the de-facto package manager used by thenode.js community. He also works for Joyent and is a big contributorto the node.js core as well. In his spare time he is trying to liberate theJavaScript community fromsemicolon slavery.

    IRC Nick: isaacs Twitter:@izs GitHub:isaacs Blog:blog.izs.me

    Where: San Fransico, USABert Belder

    Bert is the main developer working on windows support for node, andalso one of the biggest overall contributors to the project.

    IRC Nick: piscisaureus Twitter:@piscisaureus GitHub:piscisaureus

    Where: NetherlandsTJ Holowaychuk

    TJ is the author ofexpress,jadeand many other popular node.jslibraries.

    Twitter:@tjholowaychuk GitHub:visionmedia Blog:tjholowaychuk.com

    Where: Victoria, BC, Canada

    http://joyent.com/http://joyent.com/http://joyent.com/http://no.de/http://no.de/http://no.de/http://twitter.com/ryahhttp://twitter.com/ryahhttp://twitter.com/ryahhttps://github.com/ryhttps://github.com/ryhttps://github.com/ryhttp://blog.nodejs.org/http://blog.nodejs.org/http://blog.nodejs.org/http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttp://npmjs.org/http://npmjs.org/http://npmjs.org/http://blog.izs.me/post/3393190720/how-this-workshttp://blog.izs.me/post/3393190720/how-this-workshttp://twitter.com/izshttp://twitter.com/izshttp://twitter.com/izshttps://github.com/isaacshttps://github.com/isaacshttps://github.com/isaacshttp://blog.izs.me/http://blog.izs.me/http://blog.izs.me/http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttp://twitter.com/piscisaureushttp://twitter.com/piscisaureushttp://twitter.com/piscisaureushttps://github.com/piscisaureushttps://github.com/piscisaureushttps://github.com/piscisaureushttp://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttp://expressjs.com/http://expressjs.com/http://expressjs.com/http://jade-lang.com/http://jade-lang.com/http://jade-lang.com/http://twitter.com/tjholowaychukhttp://twitter.com/tjholowaychukhttp://twitter.com/tjholowaychukhttps://github.com/visionmediahttps://github.com/visionmediahttps://github.com/visionmediahttp://tjholowaychuk.com/http://tjholowaychuk.com/http://tjholowaychuk.com/http://tjholowaychuk.com/https://github.com/visionmediahttp://twitter.com/tjholowaychukhttp://jade-lang.com/http://expressjs.com/http://nodeguide.com/community.html#TOChttps://github.com/piscisaureushttp://twitter.com/piscisaureushttp://nodeguide.com/community.html#TOChttp://blog.izs.me/https://github.com/isaacshttp://twitter.com/izshttp://blog.izs.me/post/3393190720/how-this-workshttp://npmjs.org/http://nodeguide.com/community.html#TOChttp://blog.nodejs.org/https://github.com/ryhttp://twitter.com/ryahhttp://no.de/http://joyent.com/
  • 8/3/2019 NodeJS Felix

    24/31

    Tim Caswell

    Tim is the original author ofconnect, and has been contributing tonode.js since the early days. He currently works for HP (formerlyPalm), and is also known for the collaborative bloghowtonode.org.

    IRC Nick: creationix Twitter:@creationix GitHub:creationix Blog:howtonode.org Where: San Fransico, USA

    Felix Geisendrfer

    Yours truly, who is very active in the node.js core development, and

    works on projects such asformidable,mysqland this very guide.Besides node core development, I'm also the co-founder of a node.jsstartup providing file uploading & video encoding as a servicecalledtransloadit.com.

    IRC Nick: felixge Twitter:@felixge GitHub:felixge Blog:debuggable.com/blog Where: Berlin, Germany

    Mikeal Rogers

    Mikeal is the author ofrequest, and is very active in the development ofnode.js, as well as the community.

    IRC Nick: mikeal Twitter:@mikeal GitHub:mikeal Blog:mikealrogers.com Where: San Fransico, USA

    Alexis Sellier

    Alexis is a JavaScript mastermind who is responsible for projects suchasless.js,vowsand many others.

    IRC Nick: cloudhead Twitter:@cloudhead GitHub:cloudhead Blog:cloudhead.io

    http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttps://github.com/senchalabs/connecthttps://github.com/senchalabs/connecthttps://github.com/senchalabs/connecthttp://howtonode.org/http://howtonode.org/http://howtonode.org/http://twitter.com/creationixhttp://twitter.com/creationixhttp://twitter.com/creationixhttps://github.com/creationixhttps://github.com/creationixhttps://github.com/creationixhttp://howtonode.org/http://howtonode.org/http://howtonode.org/http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttps://github.com/felixge/node-formidablehttps://github.com/felixge/node-formidablehttps://github.com/felixge/node-formidablehttps://github.com/felixge/node-mysqlhttps://github.com/felixge/node-mysqlhttps://github.com/felixge/node-mysqlhttp://transloadit.com/http://transloadit.com/http://transloadit.com/http://twitter.com/felixgehttp://twitter.com/felixgehttp://twitter.com/felixgehttps://github.com/felixgehttps://github.com/felixgehttps://github.com/felixgehttp://debuggable.com/bloghttp://debuggable.com/bloghttp://debuggable.com/bloghttp://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttps://github.com/mikeal/requesthttps://github.com/mikeal/requesthttps://github.com/mikeal/requesthttp://twitter.com/mikealhttp://twitter.com/mikealhttp://twitter.com/mikealhttps://github.com/mikealhttps://github.com/mikealhttps://github.com/mikealhttp://www.mikealrogers.com/http://www.mikealrogers.com/http://www.mikealrogers.com/http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttp://lesscss.org/http://lesscss.org/http://lesscss.org/http://vowsjs.org/http://vowsjs.org/http://vowsjs.org/http://twitter.com/cloudheadhttp://twitter.com/cloudheadhttp://twitter.com/cloudheadhttps://github.com/cloudheadhttps://github.com/cloudheadhttps://github.com/cloudheadhttp://cloudhead.io/http://cloudhead.io/http://cloudhead.io/http://cloudhead.io/https://github.com/cloudheadhttp://twitter.com/cloudheadhttp://vowsjs.org/http://lesscss.org/http://nodeguide.com/community.html#TOChttp://www.mikealrogers.com/https://github.com/mikealhttp://twitter.com/mikealhttps://github.com/mikeal/requesthttp://nodeguide.com/community.html#TOChttp://debuggable.com/bloghttps://github.com/felixgehttp://twitter.com/felixgehttp://transloadit.com/https://github.com/felixge/node-mysqlhttps://github.com/felixge/node-formidablehttp://nodeguide.com/community.html#TOChttp://howtonode.org/https://github.com/creationixhttp://twitter.com/creationixhttp://howtonode.org/https://github.com/senchalabs/connecthttp://nodeguide.com/community.html#TOC
  • 8/3/2019 NodeJS Felix

    25/31

    Where: Montreal, QC, CanadaJeremy Ashkenas

    Jeremy is the author ofCoffeeScript,underscore,backbone,doccoand

    many other popular node.js / JavaScript libraries. He is also running anode.js startup calledDocumentCloud.

    IRC Nick: jashkenas Twitter:@jashkenas GitHub:jashkenas,documentcloud Where: New York City, USA

    Jed Schmidt

    Jed is a japanese translator who moonlights as a JavaScript ninja. Hisnode.js frameworkfab.jstakes a radical new approach to structuring

    your JS code, and includes all kinds of surprising aspects, exceedingmost people's understanding of JavaScript by far.

    IRC Nick: jedschmidt Twitter:@jedschmidt GitHub:jed Blog:jedschmidt.com Where: Tokyo, Japan

    Marak Squires

    Marak who goes by the alias Jim Bastard, is mostly known for pumpingout dozens of node.js libraries per month, an ability only exceeded byhis artful use of profanity and trolling people. Don't get upset if he rubs

    you the wrong way, he's a nice guy, but you just shouldn't challengehim to a Monkey Island style sword duel.

    IRC Nick: jimbastard Twitter:@maraksquires GitHub:marak Blog:blog.nodejitsu.com Where: New York City, USA

    Peteris Krumins

    Some of you may know Peter from his popular blogcatomat.net.Together with James Halliday, he has recently started a node.js startupcalledbrowserling, which has also led to tons of open source modulesfrom the two of them.

    http://cloudhead.io/http://cloudhead.io/http://cloudhead.io/http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttps://github.com/jashkenas/coffee-scripthttps://github.com/jashkenas/coffee-scripthttps://github.com/jashkenas/coffee-scripthttps://github.com/documentcloud/underscorehttps://github.com/documentcloud/underscorehttps://github.com/documentcloud/underscorehttps://github.com/documentcloud/backbonehttps://github.com/documentcloud/backbonehttps://github.com/documentcloud/backbonehttps://github.com/jashkenas/doccohttps://github.com/jashkenas/doccohttps://github.com/jashkenas/doccohttp://www.documentcloud.org/http://www.documentcloud.org/http://www.documentcloud.org/http://twitter.com/jashkenashttp://twitter.com/jashkenashttp://twitter.com/jashkenashttps://github.com/jashkenashttps://github.com/jashkenashttps://github.com/jashkenashttps://github.com/documentcloudhttps://github.com/documentcloudhttps://github.com/documentcloudhttp://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttp://fabjs.org/http://fabjs.org/http://fabjs.org/http://twitter.com/jedschmidthttp://twitter.com/jedschmidthttp://twitter.com/jedschmidthttps://github.com/jedhttps://github.com/jedhttps://github.com/jedhttp://jedschmidt.com/http://jedschmidt.com/http://jedschmidt.com/http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttp://twitter.com/maraksquireshttp://twitter.com/maraksquireshttp://twitter.com/maraksquireshttps://github.com/marakhttps://github.com/marakhttps://github.com/marakhttp://blog.nodejitsu.com/http://blog.nodejitsu.com/http://blog.nodejitsu.com/http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttp://catonmat.net/http://catonmat.net/http://catonmat.net/http://browserling.com/http://browserling.com/http://browserling.com/http://browserling.com/http://catonmat.net/http://nodeguide.com/community.html#TOChttp://blog.nodejitsu.com/https://github.com/marakhttp://twitter.com/maraksquireshttp://nodeguide.com/community.html#TOChttp://jedschmidt.com/https://github.com/jedhttp://twitter.com/jedschmidthttp://fabjs.org/http://nodeguide.com/community.html#TOChttps://github.com/documentcloudhttps://github.com/jashkenashttp://twitter.com/jashkenashttp://www.documentcloud.org/https://github.com/jashkenas/doccohttps://github.com/documentcloud/backbonehttps://github.com/documentcloud/underscorehttps://github.com/jashkenas/coffee-scripthttp://nodeguide.com/community.html#TOC
  • 8/3/2019 NodeJS Felix

    26/31

    IRC Nick: pkrumins Twitter:@pkrumins GitHub:pkrumins Blog:catomat.net Where: Riga, Latvia

    James Halliday

    James is the author of many popular node.js libraries, suchasdnode,optimistandbrowserify. He is also known for drawing cuterobots forbrowserlingwhich he runs with Peteris Krumins.

    IRC Nick: substack Twitter:@substack GitHub:substack Blog:substack.net Where: Oakland, California, USA

    Your name here

    This list is by no means exhaustive and for most parts in random order.My goal is to keep this list short enough so it doesn't become a list ofallnode.js users, but there are probably a few important names that Iforgot. So if you would like to see your name here as well, just emailme.

    2011, Debuggable Limited.

    http://twitter.com/pkruminshttp://twitter.com/pkruminshttp://twitter.com/pkruminshttps://github.com/pkruminshttps://github.com/pkruminshttps://github.com/pkruminshttp://catonmat.net/http://catonmat.net/http://catonmat.net/http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttps://github.com/substack/dnodehttps://github.com/substack/dnodehttps://github.com/substack/dnodehttps://github.com/substack/node-optimisthttps://github.com/substack/node-optimisthttps://github.com/substack/node-optimisthttps://github.com/substack/node-browserifyhttps://github.com/substack/node-browserifyhttps://github.com/substack/node-browserifyhttp://browserling.com/http://browserling.com/http://browserling.com/http://twitter.com/substackhttp://twitter.com/substackhttp://twitter.com/substackhttps://github.com/substackhttps://github.com/substackhttps://github.com/substackhttp://substack.net/http://substack.net/http://substack.net/http://nodeguide.com/community.html#TOChttp://nodeguide.com/community.html#TOChttps://github.com/joyent/node/wiki/Node-Usershttps://github.com/joyent/node/wiki/Node-Usershttps://github.com/joyent/node/wiki/Node-Usershttp://debuggable.com/http://debuggable.com/http://debuggable.com/http://debuggable.com/https://github.com/joyent/node/wiki/Node-Usershttp://nodeguide.com/community.html#TOChttp://substack.net/https://github.com/substackhttp://twitter.com/substackhttp://browserling.com/https://github.com/substack/node-browserifyhttps://github.com/substack/node-optimisthttps://github.com/substack/dnodehttp://nodeguide.com/community.html#TOChttp://catonmat.net/https://github.com/pkruminshttp://twitter.com/pkrumins
  • 8/3/2019 NodeJS Felix

    27/31

    Home / All Guides

    Felix's Node.js Convincing the boss guide

    Bad Use Caseso CPU heavy appso Simple CRUD / HTML appso NoSQL + Node.js + Buzzword Bullshit

    Good Use Caseso JSON APIso Single page appso Shelling out to unix toolso Streaming datao Soft Realtime Applications

    Convincing the bosso Building a prototypeo Finding developerso Vibrant communityo Performanceo Corporate Backing

    Convincing a client

    Now that you're all hyped up about using node.js, it's time to convinceyour boss. Well, maybe. I have had the pleasure ofconsultingfordifferent businesses on whether node.js is the right technology, andsometimes the answer is simply no.

    So this guide is my opinionated collection of advice for those of youthat want to explore whether node.js makes sense for their business,and if so, how to convince the management.

    Bad Use Cases

    CPU heavy apps

    Even though I love node.js, there are several use cases where it simplydoesn't make sense. The most obvious such case is apps that are veryheavy on CPU usage, and very light on actual I/O. So if you're planningto write video encoding software, artificial intelligence or similar CPUhungry software, please do not use node.js. While you can twist and

    bend things quite a bit, you'll probably get better results with C or C++.

    http://nodeguide.com/index.htmlhttp://nodeguide.com/index.htmlhttp://nodeguide.com/convincing_the_boss.html#bad-use-caseshttp://nodeguide.com/convincing_the_boss.html#bad-use-caseshttp://nodeguide.com/convincing_the_boss.html#cpu-heavy-appshttp://nodeguide.com/convincing_the_boss.html#cpu-heavy-appshttp://nodeguide.com/convincing_the_boss.html#simple-crud-html-appshttp://nodeguide.com/convincing_the_boss.html#simple-crud-html-appshttp://nodeguide.com/convincing_the_boss.html#nosql-node.js-buzzword-bullshithttp://nodeguide.com/convincing_the_boss.html#nosql-node.js-buzzword-bullshithttp://nodeguide.com/convincing_the_boss.html#good-use-caseshttp://nodeguide.com/convincing_the_boss.html#good-use-caseshttp://nodeguide.com/convincing_the_boss.html#json-apishttp://nodeguide.com/convincing_the_boss.html#json-apishttp://nodeguide.com/convincing_the_boss.html#single-page-appshttp://nodeguide.com/convincing_the_boss.html#single-page-appshttp://nodeguide.com/convincing_the_boss.html#shelling-out-to-unix-toolshttp://nodeguide.com/convincing_the_boss.html#shelling-out-to-unix-toolshttp://nodeguide.com/convincing_the_boss.html#streaming-datahttp://nodeguide.com/convincing_the_boss.html#streaming-datahttp://nodeguide.com/convincing_the_boss.html#soft-realtime-applicationshttp://nodeguide.com/convincing_the_boss.html#soft-realtime-applicationshttp://nodeguide.com/convincing_the_boss.html#convincing-the-bosshttp://nodeguide.com/convincing_the_boss.html#convincing-the-bosshttp://nodeguide.com/convincing_the_boss.html#building-a-prototypehttp://nodeguide.com/convincing_the_boss.html#building-a-prototypehttp://nodeguide.com/convincing_the_boss.html#finding-developershttp://nodeguide.com/convincing_the_boss.html#finding-developershttp://nodeguide.com/convincing_the_boss.html#vibrant-communityhttp://nodeguide.com/convincing_the_boss.html#vibrant-communityhttp://nodeguide.com/convincing_the_boss.html#performancehttp://nodeguide.com/convincing_the_boss.html#performancehttp://nodeguide.com/convincing_the_boss.html#corporate-backinghttp://nodeguide.com/convincing_the_boss.html#corporate-backinghttp://nodeguide.com/convincing_the_boss.html#convincing-a-clienthttp://nodeguide.com/convincing_the_boss.html#convincing-a-clienthttp://debuggable.com/http://debuggable.com/http://debuggable.com/http://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://debuggable.com/http://nodeguide.com/convincing_the_boss.html#convincing-a-clienthttp://nodeguide.com/convincing_the_boss.html#corporate-backinghttp://nodeguide.com/convincing_the_boss.html#performancehttp://nodeguide.com/convincing_the_boss.html#vibrant-communityhttp://nodeguide.com/convincing_the_boss.html#finding-developershttp://nodeguide.com/convincing_the_boss.html#building-a-prototypehttp://nodeguide.com/convincing_the_boss.html#convincing-the-bosshttp://nodeguide.com/convincing_the_boss.html#soft-realtime-applicationshttp://nodeguide.com/convincing_the_boss.html#streaming-datahttp://nodeguide.com/convincing_the_boss.html#shelling-out-to-unix-toolshttp://nodeguide.com/convincing_the_boss.html#single-page-appshttp://nodeguide.com/convincing_the_boss.html#json-apishttp://nodeguide.com/convincing_the_boss.html#good-use-caseshttp://nodeguide.com/convincing_the_boss.html#nosql-node.js-buzzword-bullshithttp://nodeguide.com/convincing_the_boss.html#simple-crud-html-appshttp://nodeguide.com/convincing_the_boss.html#cpu-heavy-appshttp://nodeguide.com/convincing_the_boss.html#bad-use-caseshttp://nodeguide.com/index.html
  • 8/3/2019 NodeJS Felix

    28/31

    That being said, node.js allows you to easily write C++ addons, so youcould certainly use it as a scripting engine on top of your super-secretalgorithms.

    Simple CRUD / HTML apps

    While node.js will eventually be a fun tool for writing all kinds of webapplications, you shouldn't expect it to provide you with more benefitsthan PHP, Ruby or Python at this point. Yes, your app might end upslightly more scalable, but no - your app will not magically get moretraffic just because you write it in node.js.

    The truth is that while we are starting to see good frameworks fornode.js, there is nothing as powerful as Rails, CakePHP or Django onthe scene yet. If most of your app is simply rendering HTML based onsome database, using node.js will not provide many tangible business

    benefits yet.

    NoSQL + Node.js + Buzzword Bullshit

    If the architecture for your next apps reads like the cookbook of NoSQLingredients, please pause for a second and read this.

    Yes, Redis, CouchDB, MongoDB, Riak, Casandra, etc. all look reallytempting, but so did that red apple Eve couldn't resist. If you're alreadytaking a technological risk with using node.js, you shouldn't multiply it

    with more technology you probably don't fully understand yet.

    Sure, there are legitimate use cases for choosing a document orienteddatabase. But if you are trying to build a business on top of yoursoftware, sticking to conservative database technology (like postgres ormysql) might just outweigh the benefits of satisfying your inner nerdand impressing your friends.

    Good Use CasesJSON APIs

    Building light-weight REST / JSON api's is something where node.jsreally shines. Its non-blocking I/O model combined with JavaScriptmake it a great choice for wrapping other data sources such asdatabases or web services and exposing them via a JSON interface.

    http://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOC
  • 8/3/2019 NodeJS Felix

    29/31

    Single page apps

    If you are planning to write an AJAX heavy single page app (thinkgmail), node.js is a great fit as well. The ability to process manyrequests / seconds with low response times, as well as sharing things

    like validation code between the client and server make it a greatchoice for modern web applications that do lots of processing on theclient.

    Shelling out to unix tools

    With node.js still being young, it's tempting to re-invent all kinds ofsoftware for it. However, an even better approach is tapping into the

    vast universe of existing command line tools. Node's ability to spawnthousands of child processes and treating their outputs as a streammakes it an ideal choice for those seeking to leverage existing software.

    Streaming data

    Traditional web stacks often treat http requests and responses asatomic events. However, the truth is that they are streams, and manycool node.js applications can be built to take advantage of this fact. Onegreat example is parsingfile uploads in real time, as well as buildingproxies between different data layers.

    Soft Realtime Applications

    Another great aspect of node.js is the ease at which you can developsoft real time systems. By that I mean stuff like twitter, chat software,sport bets or interfaces to instant messaging networks.

    But please be careful here, since JavaScript is a dynamic / garbagecollected language, your response times may sometimes varydepending on how often and long the garbage collection kicks in (at

    which point your program is stopped). So don't try to build hardrealtime systems in node, that require consistent response times.Erlang is probably a better choice for these kinds of applications.

    Convincing the boss

    Once you have determined that your use case is a good fit for node.js,it's time to convince your boss or management of giving it a go.

    http://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://transloadit.com/blog/2010/12/realtime-encoding-over-150x-fasterhttp://transloadit.com/blog/2010/12/realtime-encoding-over-150x-fasterhttp://transloadit.com/blog/2010/12/realtime-encoding-over-150x-fasterhttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://transloadit.com/blog/2010/12/realtime-encoding-over-150x-fasterhttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOC
  • 8/3/2019 NodeJS Felix

    30/31

    Building a prototype

    The best way to put your foot into the door, is to suggest taking a weekto build a simple prototype of a certain part of the application you havein mind. It's usually easy to get management to agree to that, since they

    don't have to make a long term commitment yet.

    After you've got the approval, it's usually easy to get a basic system upand running, which will provide you with much more hard data andevidence of the benefits of node.js.

    Finding developers

    Think of JavaScript whatever you want, but at this point it's becomingthelingua francaof computer programming. Pretty much every

    personal computer has one or more JavaScript interpreters (browsers)installed, which means it's almost impossible for most web developersto not learn it at some point in their career.

    This means that you get a huge and diverse pool of people you can hire,and you probably already have plenty of talent in your own company.So if you're working for a growing company, this is a strong argumentfavouring node.js.

    Vibrant community

    At this point the node.js community is growing at an insane pace,attracting some of the smartest developers in the industry. This alsomeans that the node ecosystem is growing every day, and it's also easyto get free and commercial support from various sources.

    Performance

    This argument has to be carefully played, but if performance is acritical aspect of your application, node.js has lots to offer. With fivecompanies (Mozilla, Google, Apple, Microsoft, Opera) competing overthe best JavaScript implementation, node's underlaying interpreter(Google's v8) has become insanely fast, and getting better every day.

    Combining this with node's radical model of non-blocking I/O, youhave to try very hard to create a sluggish application. Most node appsare easily capable of handling thousands of concurrent connections, on

    what could be considered moderate hardware by any standards.

    http://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://en.wikipedia.org/wiki/Lingua_francahttp://en.wikipedia.org/wiki/Lingua_francahttp://en.wikipedia.org/wiki/Lingua_francahttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://en.wikipedia.org/wiki/Lingua_francahttp://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOC
  • 8/3/2019 NodeJS Felix

    31/31

    Corporate Backing

    One of the risks with using a young open source project is the lack oflongterm commitment by its authors. This isn't the case with node.js.Node is currently sponsored byJoyent, who has hired Ryan Dahl and

    several other core contributors, so there is a real economic forcebacking the future development of the project.

    Amongst other things, this has already given companies like Yahoo!and HP (formerly Palm) enough confidence to build their nextgeneration products on node.js, so your boss can certainly relax byreading their reassuring testimonials.

    Convincing a client

    If you're a freelancer or small company doing contract work,convincing a client to use node.js might be a different story. After allthey are usually very dependent on your judgement, as well ascontinuous support for the software you create for them.

    My advice here is to be a little more conservative, and double check ifnode is a good fit. If it is, make sure that you have the resources andtime to support the application in the future. The node.js team isreleasing new versions at a rapid pace, and so you should expect a little

    work every 3-6 months to update to the latest version. 2011, Debuggable Limited.

    http://nodeguide.com/convincing_the_boss.html#TOChttp://nodeguide.com/convincing_the_boss.html#TOChttp://joyent.com/http://joyent.com/http://joyent.com/http://nodeguide.com/convincing_the_boss.html#TOChttp://debuggable.com/http://debuggable.com/http://debuggable.com/http://debuggable.com/http://nodeguide.com/convincing_the_boss.html#TOChttp://joyent.com/http://nodeguide.com/convincing_the_boss.html#TOC