📄package.json
Also known as package.json File, npm Package File
The settings file of a JavaScript project. It lists its name, its scripts and the packages it needs.
Think of it like
Think of it like the label on a lunch box. It says whose it is and lists what goes inside.
Example
Why it matters
It lets anyone set up your project with one command. Without it, nobody knows which packages to get.
Definition
Example code
json
{
"name": "my-site",
"version": "1.0.0",
"scripts": {
"dev": "next dev"
},
"dependencies": {
"react": "^19.0.0"
}
}Common mistake
Key takeaways
- 1Who it is. The name and version say what it is.
- 2What it needs. Dependencies list the packages to install.
- 3Handy commands. Scripts run with npm run.