Learn to run and structure a real Node.js project from scratch — install Node and npm, run scripts and the REPL, understand the V8 runtime and event loop, and organise code with CommonJS and ES modules. You will finish able to stand up a package.json-driven project with dependencies and npm scripts, confident about how Node executes your code.
Watch the free preview
Installing Node.js and npm — free to watch, no account needed.
What you'll learn
- Run and structure a Node.js project using package.json, npm and scripts
- Install Node and npm and confirm your toolchain from the command line
- Explain how the V8 engine and the libuv event loop execute your JavaScript
- Choose correctly between CommonJS and ES modules and wire up imports and exports
- Manage dependencies and the node_modules model with npm install and lockfiles
Syllabus
Getting Started — Installing Node and Running Code
Installing Node.js and npmFree preview
Running scripts and using the REPL
How Node Runs Your Code
The V8 engine and the event loop
Non-blocking I/O and the async model
Modules — CommonJS vs ES Modules
CommonJS — require and module.exports
ES Modules — import and export
Structuring a Project with npm
package.json and installing dependencies
npm scripts and the node_modules model
Lab — 10 Exercises & Solutions
Exercises 1–5
Exercises 6–10