Junior
From PDF
Node.js
Node.js
What is the difference between dependencies and devDependencies?
Short answer: dependencies: These are required for your app to run in production. π
Example code
express, mongoose devDependencies: Only needed during development (testing, building, linting). π Example: nodemon, eslint, jest π¦ These are defined in package.json: "dependencies": { "express": "^4.18.0" }, "devDependencies": { "nodemon": "^3.0.0" } β
Install a dev dependency with: npm install nodemon --save-dev
Say this in the interview
- Define β one clear sentence (the short answer above).
- Example β relate it to a project like ShopNest or your real work.
- Trade-off β when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png