Learn Node.js by Example
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Downloadable versions are available free1 online at: http://nelsonic.gitbooks.io/node-js-by-example/ in MOBI (Kindle), ePUB (iBooks) and PDF (everything else).
Requirements
- A computer with internet access
- Time: 30h (e.g. 2 months 30 mins per day or 1 week intensive)
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
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.
Examples
- cluster is Experimental - don't use
- domain is Unstable - don't use
- path is Stable - use
- events is Frozen - use
- assert is Locked - use
Core Modules to Learn
- path
- os
Community Modules to Learn:
1 We believe all knowledge/education should be freely available to anyone with the desire to learn regardless of their financial means! If you find this book and accompanying exercises useful, all we ask is that you share your appreciation with others by staring & tweeting! Thanks!