What happens when you run npm install?
Simple meaning
npm install reads package.json and the lockfile, then downloads packages into node_modules including transitive dependencies.
Open the full page for Why, Steps, Example and Key takeaway.
Panel-ready MERN Full Stack questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.
npm install reads package.json and the lockfile, then downloads packages into node_modules including transitive dependencies.
Open the full page for Why, Steps, Example and Key takeaway.
Express is a minimal Node framework for routing, middleware, and HTTP responses.
Open the full page for Why, Steps, Example and Key takeaway.
Middleware is a function with req, res, and next that runs during the request lifecycle.
Open the full page for Why, Steps, Example and Key takeaway.
You attach an HTTP method and path to an app or router, such as app.get('/health', handler).
Open the full page for Why, Steps, Example and Key takeaway.
req is the incoming request: params, query, body, headers, and cookies.
Open the full page for Why, Steps, Example and Key takeaway.
express.json() is middleware that parses JSON bodies into req.body.
Open the full page for Why, Steps, Example and Key takeaway.
Use res.status(code).json(payload) so the client gets the right status and Content-Type.
Open the full page for Why, Steps, Example and Key takeaway.
next() passes control to the next matching middleware or route.
Open the full page for Why, Steps, Example and Key takeaway.
MongoDB is a document database that stores BSON documents instead of rigid rows.
Open the full page for Why, Steps, Example and Key takeaway.
A document is one record, similar to a row but nested and flexible.
Open the full page for Why, Steps, Example and Key takeaway.
Mongoose is an ODM that maps MongoDB collections to Node models.
Open the full page for Why, Steps, Example and Key takeaway.
find returns matching documents as a query result list.
Open the full page for Why, Steps, Example and Key takeaway.
ObjectId is MongoDB's default unique identifier for _id.
Open the full page for Why, Steps, Example and Key takeaway.
CRUD is Create, Read, Update, and Delete.
Open the full page for Why, Steps, Example and Key takeaway.
A schema defines fields, types, required flags, defaults, and indexes for a collection.
Open the full page for Why, Steps, Example and Key takeaway.
React is a library for building user interfaces from components.
Open the full page for Why, Steps, Example and Key takeaway.
JSX is a syntax that looks like HTML inside JavaScript.
Open the full page for Why, Steps, Example and Key takeaway.
Props are inputs passed from a parent and should be treated as read-only.
Open the full page for Why, Steps, Example and Key takeaway.
useState returns the current value and a setter that queues a re-render.
Open the full page for Why, Steps, Example and Key takeaway.
useEffect runs side effects after render, such as fetching data or attaching listeners.
Open the full page for Why, Steps, Example and Key takeaway.