What do "idealTree" and "reify" mean in the context of npm?

13.3k views Asked by At

When creating a react app via "npx create-react-app [app_name]" I noticed the console log something like [#############] idealTree:[package-name]... and then the same thing with "reify" instead of "idealTree". When I search what these terms mean I only see questions relating to package installations failing.

1

There are 1 answers

3
Ortomala Lokni On

The idealTree meaning is explained in the npm source code file validate-lockfile.js:

// compares the inventory of package items in the tree
// that is about to be installed (idealTree) with the inventory
// of items stored in the package-lock file (virtualTree)

An idealTree is just the tree that is about to be installed.

In common language reify means:

make (something abstract) more concrete or real.

Reification is then the process or result of reifying.

In the context of npm, we can deduce the meaning from the npm source code file tree-types.md:

During reification, the idealTree is diffed against the actual tree, and then the nodes from the ideal tree are extracted onto disk.

In the context of npm, we can say that reify means making the idealTree concrete.