100 Days of Nodejs challenges
Join the 100 day Nodejs coding challenge. Master Nodejs with daily challenges, projects, and expert guidance.
Start coding today!
Join the 100 day Nodejs coding challenge. Master Nodejs with daily challenges, projects, and expert guidance.
Start coding today!
Day 1 - Node.JS Download and Installation
Goals
- Set up your development environment and install necessary software
- Write your first "Hello World" program
Tasks
1. Install Node.js and npm
- Download and install Node.js from the official website https://nodejs.org
- Verify the installation by running `node -v` and `npm -v` in your terminal to check the versions.
2. Install a Code Editor
- Download and install a code editor if you don't have one.
We recommend: Visual Studio Code
3. Set Up the Project Directory
- Create a new directory for your project
- Open your terminal and navigate to the project directory
4. Initialize a Node.js Project
- Run `npm init -y` in your terminal to create a `package.json` file with default settings.
5. Write Your First JavaScript Program
- Create a file named `index.js` in your project directory and write a simple program that outputs "Hello World!" in your console
Day 2 - Global Objects
Goals
- Understand and explore Node.js global objects
- Learn how to use these global objects effectively in your Node.js applications
Tasks
1. Global Objects
- __dirname: The directory name of the current module
- __filename: The file name of the current module
- process: Information about the current Node.js process
2. Understanding 'process' Object
- process.env: Access environment variables.
- process.argv: Command line arguments.
- process.exit(): Exiting the current process
- process.cwd(): Current working directory
- process.memoryUsage(): Memory usage of the Node.js process.
Day 3 - Console
Goals
- Using console for Debugging
Tasks
1. Introduction to console
- Provides a simple debugging console
- Common methods: console.log(), console.error(), console.warn(), console.time(), console.timeEnd(), console.trace()
2. Use console
- Create a file named consoleExample.js and use the above methods in your code.
Day 4 - Simple HTTP Server
Goal
- Create and run a simple HTTP server using the built-in http module
Tasks
1. Introduction to HTTP Module
- The http module provides functionalities to create an HTTP server and handle HTTP requests and responses.
2. Creating an HTTP Server
- Create a file named server.js and implement the code to create a http server on port 3000. Send 'Hello World!' as response
- Test your server by opening your browser and navigating to http://localhost:3000/. You should see Hello World!.
Day 5 - NodeJS Timers
Goal
- Use timers in Node.js to execute functions after a delay or repeatedly
Tasks
- Executes a function after a delay using setTimeout()
- Executes a function repeatedly with a delay between each call using setInterval()
- Stop a timeout and interval from running using clearTimeout() and clearInterval()
Day 6 - File System Module Basics
Node.js provides a built-in module, fs (File System), to interact with the file system. Explore how to read, write, and manage files and directories.
Tasks
- Read and write text files using both synchronous and asynchronous methods
- Append data to files
- Handle common file errors
- Create and read directories, and explore directory manipulation functions
Day 7 - Routing in HTTP Server
Implement simple routing for different HTTP endpoints
Day 8 - Express Basics
Set up an Express application and create routes
Day 9 - Middleware in Express
Use middleware functions in Express
Day 10 - Handling POST Requests
Parse and handle POST requests in an Express app
Community|Blog|Youtube|Careers|Contact Us
Have Feedback or want to contribute? Email: hello[@]100DaysOfCode.io
100DaysOfCode@2024