package.json, scripts, and deps vs devDeps
Understand package.json fields, define simple scripts, and know the difference between dependencies and devDependencies.
Why package.json?
Goal: Read and use package.json.
- Key fields: name, version, type
- scripts: run short commands
- dependencies vs devDependencies
- Semantic versions (caret/tilde) — beginner taste

Fields at a glance
package.json is a manifest with project info, scripts, and dependency lists.
// Emulate a minimal package.json as a JS object
const pkg = {
name: "hello-app",
version: "1.0.0",
type: "module",
scripts: {
start: "node index.js",
build: "echo building...",
test: "echo tests..."
},
dependencies: {
"chalk": "^5.3.0"
},
devDependencies: {
"eslint": "^9.0.0"
}
};
console.log("name:", pkg.name);
console.log("version:", pkg.version);
console.log("type:", pkg.type);
console.log("scripts:", Object.keys(pkg.scripts));

All lessons in this course
- package.json, scripts, and deps vs devDeps
- npx and semantic versioning ranges
- Local vs global tools, bins, and team-friendly workflows