This repository contains a simple demonstration of the asynchronous nature of Node.js. The code showcases how Node.js handles asynchronous operations, such as file reading, HTTP requests, and database queries, without blocking the execution of other tasks.
- Asynchronous file reading using Node.js
fs
module. - Making asynchronous HTTP requests with Node.js
http
oraxios
library. - Performing asynchronous database queries using Node.js
mongodb
ormysql
module.
To run the demonstration locally, follow these steps:
- Clone the repository:
git clone [email protected]:VodeniZeko/Async-NodeJS.git
- Navigate to the project directory:
cd async-nodejs
- Install dependencies:
npm install
- Run the demonstration:
npm start
Explore the different files in the src directory to see examples of asynchronous file reading, HTTP requests, and database queries. Each file contains comments explaining the code and its output.
- async_file_read.js: Demonstrates asynchronous file reading using Node.js fs module.
- async_http_request.js: Shows how to make asynchronous HTTP requests using Node.js http module or axios library.
- async_database_query.js: Illustrates asynchronous database queries using Node.js mongodb or mysql module.
Contributions to improve or expand this demonstration are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch
- Make your changes.
- Commit your changes
- Push to the branch
- Create a new Pull Request.
This project is licensed under the MIT License.
Contact If you have any questions or suggestions, feel free to reach out to the repository owner at [[email protected]].