Intro to Node.js and NodeSchool

Bootstrap Denton


Chrome's JavaScript engine w/o the Browser.


Open source workshops that teach web software skills.

The end!

Thanks for coming!  Let's get to work...

Stickers for everyone who completes a "workshop" today at

Just kidding :-)

But not really.  

I won't be offended if you start on a NodeSchool workshop.

1. Install Node

2. `npm install -g javascripting`

3. `javascripting`

If that's too basic, try `npm install -g learnyounode'

History of the Web

pre-1993 - Dialup BBS

Have your computer call your friends computer.  Every BBS was an island.

Essentially same as today: email, chat, downloads, and games.

Web Browser History

1993 - Before Mosaic

Lynx (text based http)

Gopher (before http)

And email...

1993 - After Mosaic

IE 1 (Mosaic Rebranded)


Web Browser History

The First Browser Wars

Internet Explorer



1996 - 2009

Microsoft licensed Netscape, then gave away IE for free by bundling with Windows.


Netscape created the Mozilla Foundation, and Firefox to promote web standards.


Different Browsers had different scripting languages.  Netscape (now Mozilla) proposed JavaScript as ECMAScript Standard in 1997



State of the web

1996 - 2009

Web Applications were incredibly hard.  

Each browser was different: Scripting, DOMs, CSS

Write for one browser, then port to others.

Firefox won because of standards and the Firebug debugger

The Second Browser War

2009 - Present




  • Developers wanted standards and features.
  • Users suffered.  
  • Web applications were Slow.

Google in 2009

Why use Chrome?

  • People use IE because it's already installed
  • People use Firefox because it's "web standards"
  • Why will people use Google Chrome?
  • Open Source: Chromium

  • Better Dev Tools than Firebug

  • Super fast "V8" JS Engine


About Web Servers?

Java - Big Teams, Big Servers

PHP - Small Teams, Commodity Hosting

"Web Scale" works by scaling horizontally.  

Don't use a 100x bigger server, make 100x more small servers.

Wait!  Did you say

Fast, Open Source JavaScript Engine w/ great dev tools?


Chrome's JavaScript engine w/o the Browser.

JS - The most installed language

  • Lighter weight than Java / .NET

  • Faster than PHP

  • Asynchronous - like the web

  • NPM Package Manager

  • One language for web client+server

  • Embedded scripting (NodeBots)

  • Actively Developed (ES6 & 7)


Non-blocking IO.  Uses callbacks, promises, streams, etc.

var data = fs.readFileSync(filename); // Rip Van Winkle
console.log(data); // 20 years later. TLDR; moonshine bad.

// A callback
fs.readFile('/etc/hosts', 'utf8', function (err,data) {
  if (err) return console.log(err);

// Promises
fs.readFileAsync('/etc/hosts')  // Creates a promise For file I/O
  // Maka parallel HTTP requests, return array of promises.
  return Promise.each(function(server) { return request(server); }  
  // All HTTP promises have resolved, now promise to write to file
  return fs.writeFileAsync('pages.json', JSON.stringify(allThosePages);
  // Somethings wrong!

Single Threaded Event Loop

What?!  Why is this awesome!

  • Web-scale +++ copies of small apps

  • Redis, MongoDB also mostly single threaded

  • Single Threaded = 1 CPU

  • Stop fighting with OS processes and threads, write asynchronous programs.

  • Fits on a micro-computer
    (e.g. Raspberry Pi, BBB, Satelite, Robots, etc)

npm - Package Management

Building big things from little things


  • 172k packages.  

  • 2 billion downloads/month

  • Crowd-sourcing Your Web App

  • express, passport, gulp, mocha, cordova, less, yoeman, ...

  • npm install -g javascripting
  • javascripting


Open source workshops that teach web software skills.

The end! (4 rlz)

Thanks for coming.  Let's get to work.

Stickers for everyone who completes a "workshop" today at

Intro to NodeSchool

By michaelcole

Intro to NodeSchool

  • 878