Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 1.97 KB

File metadata and controls

31 lines (25 loc) · 1.97 KB

Overview

This repository contains codes exploring fundamental Node.js concepts. It covers topics from basic Node.js setup to building web applications with Express:-

  • Getting started with Node.js
  • Node modules
  • Synchronous & Asynchronous programming
  • Callbacks
  • Using Express
  • Routing
  • EJS Template engine

Setup

  1. Install Node.js: Ensure you have Node.js installed on your system.
  2. Install Dependencies: Run npm install to install the dependencies listed in package.json.
  3. Run Examples: You can run each file using node filename.js (e.g., node express.js).

Files Demonstration

  • express.js: Demonstrates a basic Express.js server setup. This relates to "Getting started with Node.js" and "Using Express".

  • express-route.js: Illustrates routing in Express.js, including handling different routes and URL parameters. Covers "Routing" within the "Using Express" topic.

  • file-read.js: Shows asynchronous file reading using Node.js's fs module. Demonstrates "Asynchronous programming" and the use of "Node modules".

  • file-write.js: Demonstrates asynchronous file writing using Node.js's fs module. Also relates to "Asynchronous programming" and "Node modules".

  • module_a.js: Provides an example of creating and exporting a Node.js module. Directly covers "Node modules".

  • os.js: Shows how to use the os module to get operating system information. Demonstrates "Node modules".

  • route.js: Implements basic routing using Node.js's built-in http module. Covers "Routing" without Express.

  • package.json: Lists project dependencies (express, ejs). Important for "Node modules" (dependency management) and "Using Express" (express is a dependency).

  • package-lock.json: Ensures consistent installations. Related to "Node modules".

  • mylife.txt: A simple text file used for file read/write examples.

  • _Note: While the files demonstrate Express and package.json includes ejs, the index.ejs file is to be created in views.