Node.js by Example

Learn Node.js by Example

This Book is available free online at: http://nelsonic.gitbooks.io/node-js-by-example/ in MOBI (Kindle), PDF (everything) and ePUB (iBooks).

node intro cartoon

Requirements

What is Node.js ?

Node.js lets you easily build networked software (websites, applications "apps" using JavaScript).

Node.js is not "point-and-click" like WordPress, SquareSpace or Salesforce.com; you will need to write some "code". But as I will demonstrate, that's a lot easier than it sounds (if you're new to writing code), gives you more power/flexibility and puts you in full control.

Frequently Asked Questions (FAQ)

Q: I am New to Programming Should I Start with Node.js?

If you have never written any code of any sort before, I recommend you starting with: http://gitbookio.gitbooks.io/javascript/ You need to have JavaScript basics to make the most of Node.js

Q: Node.js is not "Version 1.0" yet can we used it in Production?

Yes! Some of the biggest organisations/companies in the world are using Node.js in Production systems.

A Short List of Companies using Node.js

Alibaba, Ajax.org, Box.com, British Sky Broadcasting (Sky/Now TV), CNN, Cloudup, Conde Nast, DirectTV, Dow Jones, eBay, Etsy, FeedHenry, GitHub, Google, Groupon, HBO, Help.com, HP, iTV, Joyent (duh!), Klout, LinkedIn, McDonalds, Medium, Mozilla, NetFlix, OpenTable, PayPal, Pearson, Q, Revolt, Square, Tesco, ThomasCook, Trello, Uber, Voxer, Walmart, Wikimedia (in progress of moving to SOA with node!) Yahoo, Yammer, Yandex, Zendesk

Want more? See: http://nodejs.org/industry/ and
https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node

Try it!

Download & Install

http://nodejs.org/download/

Node.js (Core) API

The node.js ("core") has many useful modules.

Bookmark: http://nodejs.org/api (you will come back to it)

Stability (Can we use it?)

Which node.js core package(s) can/should I use?

Every core module has a "Stability Index" rating on the node.js API.

General rule: If you are being paid to write code that runs in node.js,
pick core modules/methods with stability Stable, API Frozen and Locked.

Node.js Stability Index

Examples

Core Modules to Learn

  • path
  • os

Community Modules to Learn:

  • jscs - code style checker
  • q - promises library
  • nd - view documentation for a module