Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is deduped in npm packages list?

Tags:

node.js

npm

People also ask

What are Peerdependencies in package json?

Peer dependencies are a special type of dependency that would only ever come up if you were publishing your own package. Having a peer dependency means that your package needs a dependency that is the same exact dependency as the person installing your package.

What does @next mean in npm?

The next tag is used by some projects to identify the upcoming version.By default, other than latest, no tag has any special significance to npm itself.

What is included in npm package?

A minimal npm package should contain metadata in a package. json file and an associated source file (usually index. js). In practice, packages contain more than that and you will have at least a license file and the source in various formats.

What does * version mean in npm package dependency?

For example a dependency with a version of * would equate to any version that was greater than or equal to 0.0. 0, while 1. * would allow versions greater than or equal to 1.0. 0 and less than 2.0.


deduped is short for "deduplicated" (duplicates were removed). The documentation for npm dedupe explains how npm does this:

Searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree, where they can be more effectively shared by multiple dependent packages.

In other words, it looks if multiple packages have the same dependencies (meaning the same packages and version range) and "points" them to the same package.

The same package is referenced, so it doesn't have to be installed twice.

Also, it moves the packages "up the tree" (flattens the tree). This makes total sense as otherwise one package would have to look in the node_modules of some other package (which would be kind of messy) and helps to simplify the dependencies.

You can validate this, as every package in your dependency graph that says deduped, can be found at least one more time in the graph, usually at a higher level.

In the screenshot you posted [email protected] is a dependency of body-parser. A bit further down, it's also listed as a direct dependency of express one level higher.