Web Tech

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Node.

js
Node.js is a tool that lets you write server-side code using JavaScript.
It’s fast and efficient because it uses a powerful engine (V8) and
handles many things at the same time (non-blocking).

Advantages of Node.js
1. Fast: Uses a high-speed engine (V8).
2. Scalable: Handles multiple requests without slowing down.
3. Cross-Platform: Works on Windows, Linux, macOS, etc.
4. Large Community: Lots of reusable tools and libraries available.
5. Same Language: You can write both front-end and back-end in
JavaScript.

Node.js Console
The console in Node.js is used to print messages or debugging
information (like errors or logs) while the code runs.

Console Methods
1. console.log(): Prints normal messages or variables.
2. console.error(): Shows error messages.
3. console.warn(): Shows warning messages.
4. console.table(): Displays data in a table format.

REPL Terminal
REPL stands for Read-Eval-Print-Loop. It’s a simple tool that lets you
write and test small pieces of JavaScript code directly in the terminal.

File Handling
File handling is the ability to read, write, delete, or update files using
Node.js. You can work with files on your computer just like you would
in any program.

FS Module
The fs module (File System module) in Node.js allows you to work
with files.
1. fs.readFile(): Reads files.
2. fs.writeFile(): Writes data to files.
3. fs.unlink(): Deletes files.

Synchronous Method
In a synchronous method, code runs step by step. It waits for one
operation to finish before starting the next. It’s simpler but slower if
there’s a lot to do.

Web Server
A web server is a program that listens for requests from users and
sends back web pages, data, or responses. In Node.js, you can create
your own web server using the http module.

Web Application Architecture


This is the design or structure of a web app. It usually has:
1. Client-side: The part users see and interact with (browser).
2. Server-side: The part that processes data and handles requests
(like Node.js).
3. Database: Stores data (like user info or settings).

React.js
React.js is a tool to build user interfaces (UI) in web applications. It’s
very popular because it makes UI updates faster and easier with
reusable components.

React Components
A React component is like a Lego block for web pages. Each block
(component) has a specific job, like showing a button or a form.
Components can be reused to build big UIs.

React JS - Component Life Cycle


This refers to the stages a React component goes through:
1. Mounting: When it’s added to the page.
2. Updating: When it changes (like user clicks).
3. Unmounting: When it’s removed from the page.

React State
State is like a box inside a React component that holds dynamic data
(e.g., form inputs or a counter). If the state changes, the UI updates
automatically.
React Prop
Props are like settings you give to a component. For example, you can
pass a message or style to customize how a component looks or
works.

React Events
Events in React are how you handle user interactions, like clicking a
button or typing in a box. You use event handlers like onClick or
onChange to manage these actions.

You might also like