Member-only story
My article covers the most fundamental aspects of Node Package Manager (NPM) and package.json. If you consider yourself well experienced in this topic already, please stop here ❌.
In the JavaScript world, you will find it in nearly every codebase: package.json. As a beginner, you probably already know that it’s an important file. But what’s its real purpose? How is it generated? And why do you even have to care about it?
Here are the most important facts about the mysterious file 👽.
1) It’s NOT a big deal!
Simple as that: package.json is just a text file holding your npm package’s general configuration, formatted as JSON.
As a beginner, you most probably first came into contact with package.json on the application-level (e. g. when setting up a React app). Generally speaking, every NPM package is defined by a package.json. Not only your app itself is considered a package, but also all its dependencies.
Let’s have a look 👀 into a typical package.json of an example React app:
{
"name": "react-app",
"version": "0.0.0", "scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test"
},