Follow @endyourif rss Facebook LinkedIn

Node js Tutorial

Node js is a server-side technology that allows you to use the JavaScript programming language, but unlike when you commonly think of JavaScript it is not run on a web site inside a web browser. Node.js as a server can be compared to all other web server technology, such as: IIS, Apache, Nginix, and any others that are not coming to me off the top of my head.

Node js has a very large community and has excellent support for web servers like Express; databases like: Mongodb, Mysql, and event MSSQL.

Node JS Tutorial

Learn Node js by example

Below is a summary of Node js tutorials that will help you step by step become an expert with Node.js. This is a summary of topics I suggest learning where I have a full list describing how to get started with Node js below.

If you are a beginner and looking to get started with Node js tutorials I will describe what is Node js, when to use it, how to install, and a list of examples that I have written that will help you go from beginner to expert.

What is Node js?

  • An asynchronous event-driven written in JavaScript that executes at runtime, similar to PHP that doesn't pre-compile the code like ASP.NET
  • It is designed to build scalable network applications because of its event-driven design
  • The server can handle many concurrent connections and executes a callback to start executing your code; otherwise, Node js will sleep until the next connection is received
  • Node.js is designed with similar concepts to Ruby's Event Machine or Python's Twisted systems. If you are familiar with those languages you can make a smooth transaction from one to the other
  • Even though Node is designed without threads, you can leverage multiple cores of the server by spawning child processes with fork commands

How do I install Node js?

  1. Visit Node.js official site and download the install package based on the operating system where you will be running the technology
  2. If you have the pkg running you can also install it by running: pkg install node
  3. Once Node js is installed, I suggest configuring it to run at start of the server. I suggest running it is as service that runs on start so you don't need to manually start it each time
  4. If you want to run it with one-off commands like: node myscript.js then it would be helpful to set the location to the Node.js executable into your global path variable
  5. Install your common npm packages that you will use in all projects by including the -g or --global parameter with npm install.

How do I get started with Node js?

Below is a list of Node js articles that I have written that contain concrete examples with demos to show you not only how to program it, but what it will output:

When should I use Node js?

  • If you've been developing web sites for many years and have mastered JavaScript, you can start using Node because you can continue to use JavaScript and commonize your browser executed code with your server executed code
  • You want to use an event-driven technology that supports an asynchronous I/O architecture
  • Simplifies real-time communication between the web browser and web server without using what is known as "polling" looking for changes to update information on the user's web browser
  • You want a scalable web server that outperforms technologies that have been around for decades like Apache
  • Leverage a huge community of libraries via a package manager to simplify your development

What is npm install?

  • npm install is how you install re-usable packages published by a community of software developers
  • It helps manage the dependencies in your project and, if you want, perform automatic upgrades of Node js packages to keep your libraries/packages up-to-date
  • It is one of the easiest ways to install new packages into your projects including installing dependencies from other packages
  • Through stats like downloads and ratings in helps you use the best packages to solve the problem you are working on
My Books
ASP.NET MVC 5 With Bootstrap and Knockout.js
Knockout.js Building Dynamic Client-Side Applications
20 Recipes for Programming MVC 3
20 Recipes for Programming PhoneGap
Rapid Application Development with CakePHP