90 minutes
This lab exercise will introduce Node.js, a powerful JavaScript library that creates a webserver. This is the missing link between local deployment for development purposes and deploying a website so others can access it on the Internet.
All of Good Eggs' web services (including shopping, grocery delivery, and inventory management) use node. Most of Walmart.com is served from node.
Participants will be able to:
- Download and install Node.js
- Run commands in the Node.js REPL
- Explain non-blocking I/O
- Explain (a)synchronous calls
- Explain event-driven programming
- The main features of Node (ie: what makes Node, Node?)
- Blocking vs. non-blocking I/O
- Synchronous vs. asynchronous calls
- Why a developer might choose Node.js over other web frameworks
- Well-known companies that use Node.js
- Node.js is not a framework, it's a runtime environment for JavaScript and a JavaScript library
- Many developers think Node.js is more complicated to use than other popular web frameworks. Node.js is not necessarily more complicated to use, but it does require the developer to think about web servers differently than they do when using a web framework like Python's Django or Ruby's Rails.
After the lab exercise, participants should write down in their own words the steps they went through to create this basic web app using Node. It should be of good quality so they can refer to it later.
Participants should take turns in their pairs reading through and interpreting the app.js
file line by line.
After reading through app.js
in pairs, each participant should read through the file with a member of Techtonica staff.
- Be aware of how to find Node's API docs, and briefly familiarize yourself with its structure. You don't need to read it all now!
- Be aware that one way to install Node is by downloading it directly from their website. However, we are not using this method; we're using nvm.
- Why use Node.js? (video) Note: this is a different video than above
- Why learn Node.js? (video)
- 8 Reasons to use Node.js (video)
- The definitive Node.js handbook
- What Node.js is and isn't (video)
- Why use Node.js? (video)
- Introducing the Node.js REPL (video - only through 1:56)
- What is asynchronous JavaScript? (video)
- An introduction to asynchronous method calls (video)
- Event-driven programming: the fundamentals (video)
- Event-driven architecture (video)