Asynchronous I/O means that applications dont wait for an input/output process to finish before going on to the next step in the application code. goes into more detail on the asynchronous nature of Node.
Most importantly, Node is written in a language that many traditional web developers are familiar with: JavaScript. You may be learning how to use new technologies, such as working with WebSockets or developing to a framework like Express, but at least you wont have to learn a new language along with the concepts. This language familiarity makes it a lot easier to just focus on the new material.
This Books Intended Audience
One of the challenges associated with working with Node is that there is an assumption that most people coming into Node development have come from a Ruby or Python environment, or have worked with Rails. I dont have this assumption, so I wont explain a Node component by saying its just like Sinatra.
This books only assumption is that you, the reader, have worked with JavaScript and are comfortable with it. You dont have to be an expert, but you should know what Im talking about when I mention closures , and have worked with Ajax and are familiar with event handling in the client environment. In addition, youll get more from this book if you have done some traditional web development and are familiar with concepts such as HTTP methods (GET
and POST
), web sessions, cookies, and so on. Youll also need to be familiar with working either with the Console in Windows, or the Unix command line in Mac OS X or Linux.
Youll also enjoy the book more if youre interested in some of the new technologies such as WebSockets, or working with frameworks to create applications. I cover these as a way of introducing you to how Node can be used in real-world applications.
Most importantly, as you progress through the book, keep an open mind. Be prepared to hit an occasional alpha/beta wall and run into the gotchas that plague a dynamic technology. Above all, meet the prospect of learning Node with anticipation, because it really can be a lot of fun.
Note
If youre not sure youre familiar enough with JavaScript, you might want to check out my introductory text on JavaScript, Learning JavaScript , Second Edition (OReilly).
How to Best Use This Book
You dont have to read this books chapters in order, but there are paths through the book that are dependent on what youre after and how much experience you have with Node.
also covers some of the style issues associated with Node, including how to deal with Nodes unique approach to asynchronous development.
If you have had some exposure to Node, have worked with both the built-in Node modules and a few external ones, and have also used REPL (read-eval-print loopthe interactive console), you could comfortably skip .
I incorporate the use of the Express framework, which also utilizes the Connect middleware, throughout the book. If youve not worked with Express, youre going to want to go through .
After these foundation chapters, you can skip around a bit. For instance, if youre primarily working with key/value pairs, youll want to read the Redis discussion in and skip the Redis and MongoDB chapters, though do check them out sometimethey might provide a new viewpoint to working with data.
After those three data chapters, we get into specialized application use. covers the very popular Sockets.io module, especially for working with the new web socket functionality.
After the split into two different specialized uses of Node in , learning in-depth practices for Node debugging and testing.
is probably one of the tougher chapters, and also one of the more important. It covers issues of security and authority. I dont recommend that it be one of the first chapters you read, but it is essential that you spend time in this chapter before you roll a Node application out for general use.
is the final chapter, and you can safely leave it for last, regardless of your interest and experience. It focuses on how to prepare your application for production use, including how to deploy your Node application not only on your own system, but also in one of the cloud servers that are popping up to host Node applications. Ill also cover how to deploy a Node application to your server, including how to ensure it plays well with another web server such as Apache, and how to ensure your application survives a crash and restarts when the system is rebooted.