What metadata does the npm file package.json contain?

Experience Level: Junior
Tags: npm

Answer

A file package.json contains:

Basic information about the project (not all of them are mandatory)

  • project name
  • project description
  • project version
  • project author
  • project license
  • project homepage

scripts

Scripts are aliased command-line commands that can be executed using their alias.

dependencies

The property dependencies contains a list of dependencies (packages) the project uses and needs to have installed in order to be able to run.

devDependencies

The property devDependencies contains a list of dependencies (packages) that are used during development (like web server, minifier, uglifier, bundler, ...), but are not needed for the program to run.

Comments

No Comments Yet.
Be the first to tell us what you think.
npm for beginners
npm for beginners

Are you learning npm ? Try our test we designed to help you progress faster.

Test yourself