Node.
js
Duration: 6 half days
Pre-requisites:
• Participants should have working knowledge on basic HTML, CSS and JavaScript [
Functional style of programming and NodeJS]. [[Link]
• Complete the following JavaScript courses
o [Link]
o [Link]
o [Link]
Course Objective:
• Learn [Link], Express & how to build REST APIs using TypeScript
[Link]
• Node JS Architecture – Single Threaded Event Loop
o V8 engine
o NodeJS Bindings [API]; Event Queue; Event loop; Libuv [Async I/O);
Worker Threads
• When and When not to use is NodeJS?
• Writing asynchronous code
• Modularizing code
o Understanding built-in modules
o Techniques for modularizing JavaScirpt code
o [Link]
Export and import modules
Using npm for third-party modules
• Handling Exceptions
• Events and Streams
o Understanding Events
o EventEmitter class
o Understanding Streams
o Reading and writing streams
o Using pipe()
• HTTP Server with [Link] and Core http Module
o [Link], Web Apps and http Core Module
o [Link] Hello World HTTP Server
o [Link] Hello World HTTP Server Demo
• Unit testing with Mocha and Chai
• Child Process
o Asynchronous Process creation
exec, execFile, fork and spawn
o Synchronous Process creation
execSync, execFileSync, and spawnSync
o Events:
close
disconnect
error
exit
message
o Cluster
take advantage of multi-core systems
• Worker Thread
How worker threads work?
Using Worker Threads
Creating and executing new Workers
• Debug
o Inspect
o [Link] debugging in VS Code
o V8 Inspector Integration for [Link]
o Enabling remote debugging scenarios
o Node inspector
TypeScript
• JavaScript types
• Typescript types
o Numbers, string, Booleans
o objects and arrays
o Tuples, Enum
o The any and unknown types
• Functions
• Next Generation JavaScript and TypeScript
o The let and const keywords
o Arrow Functions
o Default Function parameters
o The spread operators
o Rest Parameters
o Destructuring arrays and objects
o Class
Private and public access modifiers
Inheritance
Protected access modifiers
Getters and setters
Static methods
Abstract classes
o Interfaces
o Generics
o Generic Function
o Generic classes
o Modules and Namespaces
Using ES modules
Using import and export
• Decorators
o Decorator factories
o Building decorators
Class decorators
Method decorators
Property decorators
Parameter decorators
JavaScript Build Automation tools
o Rush
What is Monorepo?
Using Rush
• Rush Commands
Rush Stack: Heft
• Architecture: Action, plugin, hook, task, stage, rig package
and rig profile
• Getting started with Heft
• Adding tasks
o TypeScript, ESLint and JEST
• Interfacing with Rush
• Using
[Link]: Building REST APIs
o Installing [Link]
o REST APIs and JSON
Using Express to Provide an API
CRUD operations
Routing
• Routes and SEO
• Route Handlers
• Route Paths and Regular Expressions
• Parameters and queries in routing
• Declaring Routes in a module
o Error Handling
Catching errors
Default handlers
Writing error handlers
o Debugging Express
o Cookies and Sessions
Cookies in Express
• cookie-parser, cookie-session
Using sessions
• Implement Flash messages
Session Management
Secure use of cookies
• Using Cookie flags “secure” – for HTTPS and “HTTPOnly” --
to help prevent attacks such as cross-site scripting
• Cookie Scope