An Introduction to NodeJS

Presented by Carlos Justiniano / HC.JS / @cjus / ver: 1.0.0

About me

  • Carlos Justiniano, HC.JS founder and a long-time programmer
  • A fullstack developer using NodeJS since 2011
  • Developed Node applications in production use
  • Developer at MediaMath, note: we're hiring!

Node = NodeJS

So, what is Node?

  • "Node.js is an open source, cross-platform runtime environment for server-side and networking applications". - Wikipedia
  • A platform for building applications, using JavaScript, for use on and off the net
  • An application optimized for performing high speed input/output operations

Node's early beginnings

  • Node was created in 2009 by Ryan Dahl which he first published for under Linux
  • Ryan debuted Node at the November 2009 European JSConf where it received a standing ovation
  • Node's continued development was sponsored by Joyent the company where Ryan worked

Node's popularity


Who uses Node?

  1. Backed by the Node.js Foundation
  2. Supported by Google, Microsoft and IBM
  3. Supported by a legion of open source developers
  4. And it's used by a few companies you may have heard of ☞
  • Google
  • Microsoft
  • IBM
  • SAP
  • StrongLoop
  • Netflix
  • Walmart
  • Target
  • LinkedIn
  • Mozilla
  • PayPay
  • New York Times
  • Fidelity Investments
  • Uber

And many many more:

Getting started with Node

  • Download and Install Node for your machine at:
  • Click on the big green Install button

Confirming Node is installed

      $ node --version

Sample Code!

All of the sample code in this presentation is available on the GitHub repo's subfolder:


Sample Code: A really simple Node app


  • Node as a JavaScript execution engine
  • A node script can be a one line program
  • Super easy to get started using Node

      console.log('Hello future Node developers!');

Sample Code: OSInfo


  • How to write a Node commandline program that accepts arguments
  • Calls to the Node process object for querying operating system and environment variables
  • Available here:

Sample Code: WordCount


  • Yet another commandline program
  • How to read and process text files using Node
  • How to use and write external Node modules
  • Available here:

Sample Code: hello using Node

  • Demos a simple Node application which responds to a web request with a text message

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, '');
console.log('Server running at');

Introducing Express

  • You can build incredibly powerful networking applications using Node and built-in networking features
  • However, as a backend web developer you don't want to write your own version of Apache or Nginx
  • Enter web frameworks, such as Express.JS

Building web applications using Node

  • Express.JS is a Fast, unopinionated, minimalist web framework for Node.js
  • Express is a framework that handles much of the functionality found in web servers
  • Available at:

Installing Express

  • Because Express is a framework that sits on top of Node, you'll need to make sure you have Node installed.
  • Simple instructions here:

  $ mkdir myapp
  $ cd myapp
  $ npm init
  $ npm install express --save

Sample Code: hello using Express.JS


  • A simple Node/Express application which responses to a web request with a text message
  • Available here:

var express = require('express')
var app = express();

app.get('/', function(req, res) {
  res.send('Hello World');


Installing Express Generator

  • Express Generator is a Node based commandline program which can generate the basic skeleton of a non-trivial web application
  • This saves you from building boilerplate code common to most web server applications you'll build
  • Simple instructions here:

$ mkdir myapp
$ cd myapp
$ npm init
$ npm install express-generator -g

Then you can use express-generator:

$ express myapp

Sample Code: Login


  • How to build a Node and Express web application
  • How to serve web pages and handle RESTFul API calls
  • Available here:

What's next?

  • Visit the links in this slide and try the sample apps

The next Node talk will feature:

  • Building more advanced Node applications
  • A look at NPM - the Node Package Manager
  • Building your own Node modules
  • Publishing NPM packages
  • Extending Node, using C++
  • Building a RESTful API server using Node
  • Node and Microservices


  • cjus on Twitter and Github
  • Email:
  • About: