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
- Install Node.js: Ensure you have Node.js installed on your system.
- Install Dependencies: Run
npm installto install the dependencies listed inpackage.json. - Run Examples: You can run each file using
node filename.js(e.g.,node express.js).
-
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
fsmodule. Demonstrates "Asynchronous programming" and the use of "Node modules". -
file-write.js: Demonstrates asynchronous file writing using Node.js's
fsmodule. 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
osmodule to get operating system information. Demonstrates "Node modules". -
route.js: Implements basic routing using Node.js's built-in
httpmodule. 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.