Difference between package.json vs package-lock.json
package.json |
package-lock.json |
---|---|
It displays the basic information about the project |
It describe a exact tree structures that allow to download identical trees |
It is required for every project. |
It is automatically generated when installing node modules |
It contains information such as name, description, author, script, and dependencies. |
It contains the name, dependencies, and locked version of the project. |
What is package-lock.json ?
package-lock.json is a file that is generated when we try to install the node. It is generated by the Node Package Manager(npm). package-lock.json will ensure that the same versions of packages are installed.
It contains the name, dependencies, and locked version of the project. It will check that same versions are installed for the different users so that errors can be prevented (Dependency locking).
Table of Content
- Steps to get package-lock.json file
- Properties of package-lock.json
- Key Features of package-lock.json
- Best Practices of package-lock.json
- Difference between package.json vs package-lock.json