0% found this document useful (0 votes)
6 views2 pages

Nodejs Revision

This document provides a concise overview of Node.js, covering key concepts such as its runtime environment, package management with NPM, and the use of modules. It also discusses important features like the HTTP module, Express.js for routing, and various asynchronous patterns including callbacks, promises, and async/await. Additionally, it highlights error handling, REST API operations, CORS, JWT for authentication, and the MVC pattern for app structure.

Uploaded by

swapnilpant0652
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Nodejs Revision

This document provides a concise overview of Node.js, covering key concepts such as its runtime environment, package management with NPM, and the use of modules. It also discusses important features like the HTTP module, Express.js for routing, and various asynchronous patterns including callbacks, promises, and async/await. Additionally, it highlights error handling, REST API operations, CORS, JWT for authentication, and the MVC pattern for app structure.

Uploaded by

swapnilpant0652
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

🟢 Node.

js Revision Summary
Topic Key Concept Syntax / Example Important Notes
JavaScript runtime Runs JS outside
What is [Link]? node [Link]
built on V8 browser
Manages
NPM Package manager npm init -y
dependencies
CommonJS by
Modules Reusable code require('fs')
default
Modern Use "type":
ES Modules import fs from 'fs'
import/export "module"

Async & sync


File System (fs) Read/write files [Link]()
versions
HTTP Module Create server [Link]() Core module
[Link] Web framework [Link]('/', fn) Simplifies routing
Based on HTTP
Routing Handle endpoints [Link]('/login')
methods
Functions between
Middleware [Link]() Order matters
req & res
Needs body-
Request Object Client data [Link] , [Link]
parser
Response Object Send data [Link]() Ends request cycle
Event Loop Async handling Non-blocking I/O Single-threaded
Can cause
Callbacks Async pattern [Link](file, cb)
callback hell
Promises Better async .then().catch() Avoid nesting
Async/Await Cleaner async await fetchData() Built on promises
Efficient for big
Streams Process large data [Link]()
files
Used in file
Buffer Binary data [Link]()
handling
Environment Use dotenv
Config values [Link]
Variables package
Error Handling Handle errors try/catch Always handle

Untitled 1
Topic Key Concept Syntax / Example Important Notes
async errors
GET, POST, PUT, Common backend
REST API CRUD operations
DELETE pattern
Cross-origin Needed for
CORS cors() middleware
requests frontend
JWT Authentication [Link]() Stateless auth
Models, Views,
MVC Pattern App structure Clean architecture
Controllers

Untitled 2

You might also like