What is a npm package?

Experience Level: Junior
Tags: npm

Answer

In general, Npm package is a folder containing a program described by a package.json file.

The folder usually contains files with source code, assets (images, videos, CSS files), documentation and other files.

  • A package can also be called a module.

When someone refers to a package, he usually thinks about the folder with source files. However, the packages can be distributed in different forms:

  • A package can be distributed as a gzipped archive.
  • A package can be also a URL that points to gzipped archive.

For that reason, the package locaiton can be represented by

  • Local path to a folder
  • Local path to a gzipped archive
  • URL to a gzipped archive 
Related npm job interview questions
npm for beginners
npm for beginners

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

Test yourself