Node.js Introduction and Resources

JavaScript began life as a lightweight scripting language for use in web browsers. At first, it was a barely powerful enough to provide silly effects and basic form data validation. Over time, it got more and more powerful, and is now used by serious developers building complex web applications.

Perhaps the most surprising development in the history of this widely-used language is that you can now use JavaScript on the server, and not just in-browser. With the invention Node.js, a server-side JavaScript environment, JavaScript has become a "full-stack" language — meaning that you can develop real web applications using just JavaScript, without a more conventional server-side language such as PHP, Ruby, or Python.

Node.js is an exciting piece of technology. It is changing the way we build web applications, and it has spawned a whole ecosystem of interesting tools for making web development more efficient and more fun.

Sometimes, with new or trendy technology, it can be difficult to figure out the best approach for learning, or the best resources to use. This guide will explain the most important things to know about Node.js and point you to the most useful resources for learning the platform, the most important development tools, and the best ways for keeping up with this technology as it develops.

About Node.js

Node.js is a cross-platform JavaScript runtime environment, designed for web server use. This simply means that it is a system for running JavaScript, which can take input from and deliver output to a web server, and interact with its own host environment. So, for example, it can receive an HTTP request, find needed information in a file or database, process the information it has found, and present a response back to the requestor.

Node.js is a not a full-scale application development framework. It's much simpler and stripped-down than that. It provides a platform for running JavaScript on the server, along with a system API for the local environment.

(If you are looking for a web development framework to use with Node.js, the most popular one is Express.js.)

Node.js Architecture

Node.js is event-driven. There is an "event loop" which is constantly listening for new inputs or other triggers ("events"). When it encounters an event, it executes whatever code has been tied to that event. This is similar to JavaScript in the browser, which might listen for events such as mouse-clicks of keyboard presses. In the case of Node.js, the events might be HTTP requests from the server, function call-backs, events kicked off by various processes running on the server, or timed alerts.

This event-driven architecture has strengths and weaknesses. It is especially well-suited for real-time, interactive applications — such as multi-user chat. On the other hand, it is poorly optimized for complex calculation and data processing: the single-threaded event loop will hold up the entire application if a single operation takes a long time to complete.

Node.js is also highly modular. This has as much to do with the development culture and ecosystem as it does with Node.js itself. Node.js modules (called "packages") are typically built with small, self-contained bits of functionality and then composed into a larger application. The Node.js community has a "share gleefully" ethos, and it is easier to share and use small modules than large, purpose-built applications.

Node.js Tutorials

The most important place to start learning Node.js is the official documentation. But sometimes you need a nice walk-through. The following tutorials should get you going with Node.js right away:

  • The Node.js tutorial at Tutorials Point is a bit superficial, but is a clear and easy way to start getting some familiarity with the language; they also have a nice introduction to the Express framework;
  • Node.js Tutorial – Step-by-Step Guide For Getting Started provides both a methodical introduction to using Node and a bit of background on how it works and why it's such a cool idea;
  • Real-time Web with Node.js is a premium, multi-part course on Node designed to take 6-8 hours to complete; the first lesson is free;
  • Node.js Tutorial at the Udemy blog provides an excellent one-sitting tutorial for getting something small, but meaningful, up and running in Node;
  • Node.js Tutorials: From Zero to Hero with Nodejs is a four-hour video tutorial that will cover enough Node.js for you to build a basic application;
  • Nodeschool is a website and global community for learning Node.js and related technologies; they have a large number of open source tutorials and exercises, plus anetwork of in-person meetings and groups.

Node.js Books

The following books focus in on one specific aspect of Node.js development:

Npm Resources and Tutorials

The most popular platform for sharing Node.js modules is npm, which is a package manager for Node.js, but which definitely doesn't stand for "Node Package Manager".

Summary

With the advent of Node.js, and related technologies like JSON, it is now possible to be a full-stack well developer while only being really great with a single language: JavaScript. This presents an amazing opportunity for developers — focusing on a single language can provide a high degree of leverage and flexibility.

So, if you are interested in Node.js, don't just try to learn Node.js. Commit to learning JavaScript deeply.


Further Reading and Resources

We have more guides, tutorials, and infographics related to coding and development:

What Code Should You Learn?

Confused about what programming language you should learn to code in? Check out our infographic, What Code Should You Learn? It not only discusses different aspects of the languages, it answers important questions such as, "How much money will I make programming JavaScript for a living?"