"A package management system is a collection of software tools that automate the process of installing, upgrading, configuring, and removing computer programs for a computer's operating system in a consistent manner." https://en.wikipedia.org/wiki/Package_manager
Which is "an interactive system for managing the source code dependencies of a single project in a particular language. That means specifying, retrieving, updating, arranging on disk, and removing sets of dependent source code, in such a way that collective coherency is maintained beyond the termination of any single command. Its output — which is precisely reproducible — is a self-contained source tree that acts as the input to a compiler or interpreter. " https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527
A Package Manager (PM) maintains our codes dependencies which includes the entire dependency tree and can reproduce the same dependency tree output given the same dependency tree input.
Think of a PM as an idempotent operation (or a pure function), given the input of A it will always return the same output of 1.
Consistent Reproducible Builds!
Package Manager states (Inputs/Outputs)
Directly from npm:
https://docs.npmjs.com/files/package-locks
The presence of a package lock changes the installation behavior such that:
Credit & Sources