Node.js Exercises
Apply your knowledge with interactive coding challenges. Complete these 55 Node.js exercises to master the language.
55
Total Challenges
0
Completed
55
Remaining
0% Complete
Hello Node.js
Print a message to the console.
NODEJS Exercise: HTTP
Practice HTTP in nodejs with this interactive exercise.
Process Version
Print the current Node.js version.
NODEJS Exercise: File System
Practice File System in nodejs with this interactive exercise.
Import a Module (CJS)
Import the `fs` module using CommonJS.
NODEJS Exercise: Path
Practice Path in nodejs with this interactive exercise.
Import a Module (ESM)
Import the `path` module using ES Modules.
NODEJS Exercise: Events
Practice Events in nodejs with this interactive exercise.
Read a File Synchronously
Read a file synchronously.
NODEJS Exercise: Streams
Practice Streams in nodejs with this interactive exercise.
Read a File Asynchronously
Read a file using Promises.
NODEJS Exercise: Buffers
Practice Buffers in nodejs with this interactive exercise.
Write to a File
Write text to a file.
NODEJS Exercise: Child Processes
Practice Child Processes in nodejs with this interactive exercise.
Join Paths
Join two paths together safely.
NODEJS Exercise: Cluster
Practice Cluster in nodejs with this interactive exercise.
Emit an Event
Emit a custom event.
NODEJS Exercise: Globals
Practice Globals in nodejs with this interactive exercise.
Create an HTTP Server
Create a basic web server.
NODEJS Exercise: Modules
Practice Modules in nodejs with this interactive exercise.
Listen on a Port
Start the server on port 3000.
NODEJS Exercise: HTTP
Practice HTTP in nodejs with this interactive exercise.
Send an HTTP Response
Respond to a request.
NODEJS Exercise: File System
Practice File System in nodejs with this interactive exercise.
Send a JSON Response
Set headers and send JSON.
NODEJS Exercise: Path
Practice Path in nodejs with this interactive exercise.
Read Environment Variables
Access an API key from the environment.
NODEJS Exercise: Events
Practice Events in nodejs with this interactive exercise.
Parallel Promises
Run two promises in parallel.
NODEJS Exercise: Streams
Practice Streams in nodejs with this interactive exercise.
Express.js Route
Create a GET route.
NODEJS Exercise: Buffers
Practice Buffers in nodejs with this interactive exercise.
MongoDB Connect
Connect to MongoDB via Node.
NODEJS Exercise: Child Processes
Practice Child Processes in nodejs with this interactive exercise.
SQL Connect
Connect to Postgres via Node.
NODEJS Exercise: Cluster
Practice Cluster in nodejs with this interactive exercise.
Child Process Execution
Execute a shell command.
NODEJS Exercise: Globals
Practice Globals in nodejs with this interactive exercise.
Hash Data
Hash a string using bcrypt.
NODEJS Exercise: Modules
Practice Modules in nodejs with this interactive exercise.
Sign a Token
Sign a JSON Web Token.
Read Stream
Create a read stream.
Pipe a Stream
Pipe a stream to a response.
Node Fetch API
Make an outbound HTTP request.
Parse JSON Data
Parse a JSON string.
Timers
Schedule a task.
Try Catch
Handle an error in async code.
Parse a URL
Parse a URL using the URL class.
OS Free Memory
Get free system memory.
Export a Module (CJS)
Export a function using CommonJS.
Export a Module (ESM)
Export a function using ES Modules.
Load Dotenv
Load environment variables from a .env file.
HTTP Status Code
Send a 404 Not Found response.
CORS Headers
Set an Access-Control-Allow-Origin header.
Create a Buffer
Create a Buffer from a string.