Npm - Package (or Module)

> (World Wide) Web - (W3|WWW) > Javascript (Js|ECMAScript) > Node - npm cli (Node package manager)

1 - About

package (ie module) in Node

A Package is the installation or public property of a Module.

The unique identifier is its name and version together defined in the package.json

A package can be installed


3 - Management

3.1 - Name

A package is:

  • a folder containing a program described by a package.json file
  • a gzipped tarball containing the folder
  • a url pointing to a tarball
  • a <name>@<version> that is published on the registry
  • a <name>@<tag> (see npm-dist-tag)
  • a <name> that has a “latest” tag satisfying
  • a <git remote url> that resolves to a folder
npm install git+ssh://
npm install sax@git+ssh://
npm install git+

3.2 - Installation / Update / Delete



3.3 - Install all project dependency

3.4 - How to create a package (module)

3.5 - Scope (Private Module)

To create a scoped package, you simply use a package name that starts with your scope.

  "name": "@username/project-name"


3.6 - Version

If there is no package.json file in the root directory, the latest version of the package is installed.

If there is package.json file, the latest version satisfying the semver rule declared in package.json for that package (if there is any) is installed.


Tags are a supplement to semver (e.g., v0.12) for organizing and labeling different versions of packages. In addition to being more human-readable, tags allow publishers to distribute their packages more effectively.


3.7 - Repository

web/javascript/npm/package.txt · Last modified: 2019/05/25 14:02 by gerardnico