Description
Introduction to Node.js teaches the fundamental concepts involved in writing server-side applications using Node.js. Students will learn about Node.js best practices and conventions while working with popular libraries, frameworks, and back-end services to write a variety of different applications.
Topics covered in the course include:
- js concepts and conventions
- ES6+ syntax
- Understanding callbacks and asynchronous code
- Finding and installing modules with NPM
- Creating, using, and publishing modules
- Listening for and handling events
- Working with streams
- Promises
- RESTful APIs
- express
- MongoDB
Audience
This course is for professional JavaScript programmers and back-end web developers.
Prerequisites
Students should have at least a beginning to intermediate level of knowledge with JavaScript. Specifically, they should be comfortable working with JavaScript functions and objects.
Pricing
This course is available for lease on a per seat / per day rate by trainers and training companies. The courseware includes slides, notes, assignments, and complete source code for all assignments.
Duration
3-day
Course Outline
- Introduction
- What is Node.js?
- What is it good for?
- What is it not good for?
- History of Node.js
- Who Uses Node?
- How Does Node.js Work?
- Node’s REPL
- Your First Node Program
- Lab: Intro to Node
- What is Node.js Made Of?
- How is Node.js Different?
- Lab: First Look at Async Code
- Node Modules
- Modules Overview
- CommonJS Example
- Using Modules
- Modules vs. Packages
- Sources of Modules
- npm
- node_modules
- package.json
- Npm Install
- Examples of packages from npm
- Lab: Intro to npm
- Node’s Core Modules
- The http Module
- The http Module (cont)
- Lab: A Simple Node.js Server
- The fs module
- Buffer Objects
- Modularizing Your Code
- Returning Values from Modules
- Using a Local Module
- Lab: Creating Modules
- ES6 Modules
- Modules Overview
- Events and Streams
- Non-blocking with Events
- Events
- EventEmitter
- Code Walkthrough: Extending EventEmitter
- Code Walkthrough: Emit events from a function
- Node Stream Objects
- Types of Streams
- Using Readable Streams
- Using Writable Streams
- Duplex and Transform Streams
- Lab: Working with Streams
- The pipe method
- Lab: Piping Between Streams
- The process Object
- Command Line Arguments
- Lab: The process object
- Understanding Callbacks
- Using Callbacks
- Node’s Error Convention
- Promises
- What Are Promises?
- Promises vs. Event Listeners
- Why Use Promises?
- Demo: Callback vs. Promise
- Using Promises
- Promises with Bluebird
- async/await
- Upgrading to async/await
- Lab: Promises
- Node on the Web
- How the Web Works
- HTTP
- HTTP Methods
- Making an HTTP Request
- Lab: Getting Data with HTTP
- RESTful Web Services
- RESTful Web Services in Practice
- Lab 11: Making a Bot
- Lab 12: Making a Hello World Bot
- How the Web Works
- Testing and Debugging
- Test Driven Development
- The TDD Cycle
- TDD Steps
- Assertions
- JavaScript Testing Frameworks
- JS Exception Handling
- TDD vs. BDD
- The assert module
- Using assert
- Lab: Testing with assert
- Mocha and should.js
- Testing with Mocha and should.js
- Running Tests with Mocha
- Test Driven Development
- Using Express
- What is Express?
- Getting Started with Express
- Express Hello World Server
- Routing with Express
- Serve Static Content with Express
- Lab: Make an Express Server
- Database Access with Node.js
- mongod and mongo
- Use MongoDB in Node
- Insert Data
- Test it out
- Retrieve from MongoDB
- Lab: hapi 16
- Lab: Async Await and hapi 17