How To Node is a tutorial blog from the early Node.js days with code examples on Express, MongoDB, streams, and more.
HN commenters recommend it as having the best Node.js examples with working code, and list it among good free learning resources.
Node handles one request at a time. It isn't multithreaded. It will receive a request, process that request and return a response. If another request comes in at the same time another request is in process, it is queued until the currently processing request is finished. I googled around, here is a good explanation for you. http://howtonode.org/understanding-process-next-tick
The way my application worked is that we had 'long' running things like saving data to a database happening before we return a response to a client (in this case an iphone app). Sometimes mongo, the dyno, networking, phase of the moon, talking to the facebook api, etc... we would get 'slow' processing and it would take a few seconds for a response to make it to the client. As soon as this happens, on a heavily loaded system, the heroku router would get backed up (since it only routes to 2-3 dynos at a time) and would start throwing H12 errors.
So, what we did was rewrite the entire app to do minimal data processing in the web tier, send the response back to the client as quickly as possible. At the same time, we also send a rabbit queue message out with all the instructions in it to process the data 'offline' in a worker task. There is no spinup since these workers are running all the time. We even have several groups of workers depending on the message type so that we can segregate the work across multiple groups of dyno workers. This also allows us to easily scale to more than a 100 dynos to process…
> http://howtonode.org
Very infrequent updates. I was told that it shouldn't matter, but ran into several problems immediately when I tried some of their tuts.
> http://nodejs.org/documentation/tutorials
Only lists NodeSchool. Why not just list NodeSchool?
> http://nodetuts.com/ (video tutorials)
Last updated a year and a half ago.
http://blog.modulus.io/absolute-beginners-guide-to-nodejs
So basic it's almost useless. It introduces you to including modules, package.json, and callbacks, but if you want to actually go further, there's not much help.
>When you are done, look at this list of extensive node at Stackoverflow:
>http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js
Pretty out of date as well.
OP: There's not a ton of resources for jumping into Node easily. The majority of the ones I've found haven't worked for me--however, that could just be me, not being an experienced programmer. I just took the Real Time Web with Node.js course at CodeSchool, and it was pretty good. I learned a lot, familiarized myself with certain modules and functions, and was able to come out of it feeling positive about the experience. Highly suggested.
It's a pity that this is so difficult to try. The blog post has so much detail and effort put into it, but all that shine and polish disappears when you try to install it.
Specifically Step 1 of the instructions[1] has a link titled "install node and npm" [2] which has the line 'git clone git://github.com/ry/node.git', which is incorrect. The correct URL (as far as I can tell) would be 'git://github.com/joyent/node.git'.
In addition the linked instructions say nothing of npm, which can be installed quite easily by running 'curl http://npmjs.org/install.sh | sh' as root.
Back to the TermKit instructions again, and step 5 says 'git clone git@github.com:unconed/TermKit.git --recursive', which didn't work for me. What worked was 'git clone git://github.com/unconed/TermKit.git --recursive'.
Finally after all that, I just see 'You cannot use this version of the application TermKit.app with this version of Mac OS X.'. Would have been nice to mention that at the start.
[1]: https://github.com/unconed/TermKit
[2]: http://howtonode.org/how-to-install-nodejs
JSHint [1] - don't fall prey to JSLint's dictatorship
UglifyJS [2] for compression
For debugging: get used to webkit inspector and Firebug. console.log is the best thing since sliced bread (object inspection, etc). Use a `debugger;` statement to insert breakpoints [3].
node.js: get started with Express [4] and mocha [5]. Make the jump to coffeescript after you're comfortable, it's a great fit on the server. Read howtonode's articles to get an introduction to various aspects of node [6].
[1] jshint.com
[2] https://github.com/mishoo/UglifyJS
[3] https://developer.mozilla.org/En/Debugging
[4] http://expressjs.com
[5] http://visionmedia.github.com/mocha/
[6] http://howtonode.org/
I have a question about Node.js
I hope it's legitimate.
If I have a endless loop in some method that is supposed to generate some part of some webpage of my webapp will it stall the whole app until I restart the server?
From my tests it seems so.
What additional facilities are required to be used so that single bug won't kill the whole app for all users?
Rant mentiones putting nginx in front of node.
UPDATE:
It seems that there is a tool called monit that can restart your server when it stalls:
http://howtonode.org/deploying-node-upstart-monit
I would recommend that you ask this question on the nodejs Google group to get a better response (https://groups.google.com/forum/#!forum/nodejs) or Stack Overflow.
Update: Also, the good folks at nodejitsu have compiled a great resource at http://docs.nodejitsu.com/
And more links:
http://www.readwriteweb.com/hack/2011/04/6-free-e-books-on-nodejs.php
http://howtonode.org/
http://nodebeginner.org/index.html
http://www.manning.com/cantelon/ (node.js in action meap)
http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-nodejs