Learning Node |
Author: Shelley Powers Node.js has become very popular. Does this book tell yoiu what you need to know? Node is serverside JavaScript and the big problem is that after you have said that much of what follows tends to be very specific to what you are trying to do. A good book on Node should give you the basics as quickly as possible and then get on to some more advanced topics and this is mostly what this book does. The first thing to say is that this is not for the JavaScript beginner. It assumes that you not only know JavaScript but know how to make use of it on the clientside.
Chapter 1 goes through the basics of getting started on Ubuntu and with the help of WebMatrix on Windows. I'm not sure WebMatrix is a good choice and things have moved on since the chapter was written. Next we have a Hello World in Node and an explanation of the asynchronous nature of Node verses the more usual threading approach used by web servers such as Apache. Chapter 2 moves on to consider using the REPL Read-Eval-Print-Loop to work interactively with Node. I found this chapter interesting, but not particularly useful because I hate working with a REPL - but you may not agree.
From here we start to look at the core of Node and in Chapter 3 encounter globals, timers, TCP servers, sockets, processes and so on. It's not a particularly logical collection of topics, but it is what you will find inside of a basic Node setup. Chapter 4 moves on to modules - how you can load one and how you can make your own. The next chapter looks at the central problem of using Node, or even client side JavaScript - how to handle async operations. Shelley Powers provides a good discussion of the problems that arise in a way that it is down to earth and clear. She points out that Promises have been removed from Node and it is up to you to work out how best to handle nested callbacks - a case of picking the module you want to use. The next big problem in using Node is getting an organization for a web site. After considering how to do it from scratch in Chapter 6, we explore using Connect as middleware to build a site. Chapters 7 and 8 look at using an alternative, the well known Express framework. The next three chapters look at working with database in Node. Chapter 9 is about Redis, Chapter 10 MongoDB and Chapter 11 MySQL. Next we have a look at how to handle serverside graphics and video, and an in-depth look as websockets. The final three chapters are concerned with wider issues of using Node. Testing and debugging, security and finally scaling. The scaling chapter includes a discussion of deploying Node to a cloud service - Azure, Amazon etc. Overall this is a good introduction to Node, but it isn't for the beginner. You do have to be able to program in JavaScript and you need to be fairly sophisticated in your approach to coding. The book isn't perfect but it does deserve a second edition. It is a good book if you need to find out what Node and its infrastructure are all about. It doesn't completely solve all of the problems that come with using Node and it doesn't provide a guide as to whether Node is a good choice for your project. But if you read the book you should be able to do something about both things yourself.
|
|||
Last Updated ( Tuesday, 03 December 2013 ) |