DSContEd / IntroWebDevelopment

At the end of the course, students will be able to plan, design, and implement a web site using current standards and best practices.
1 stars 1 forks source link

Environment: What is "package.json" and why is it useful? #7

Open TonyGoodDay2 opened 7 years ago

TonyGoodDay2 commented 7 years ago

What is "package.json" and why is it useful?

cmitchell74 commented 7 years ago

The best way to manage locally installed npm packages is to create a package.json file.

A package.json file affords you a lot of great things:

  1. It serves as documentation for what packages your project depends on.
  2. It allows you to specify the versions of a package that your project can use using semantic versioning rules.
  3. Makes your build reproducible which means that its way easier to share with other developers.
jjsahn commented 7 years ago

All npm packages contain a file, usually in the project root, called package.json - this file holds various metadata relevant to the project. This file is used to give information to npm that allows it to identify the project as well as handle the project's dependencies.