Three words from the last three days, and they overlap on purpose:
A library is the code.
A package is the code wrapped for distribution, with a name and a version.
A dependency is a package your project has installed and relies on.
A package has a small file that says what it's called, what version it is, and which other packages it needs. That's how the dependency tree from yesterday gets built: the package manager reads that file, fetches what's listed, then reads those files, and keeps going.
Your own project is a package too. package.json at the top of a JavaScript project describes it the same way.
Quick check: You run pip install requests. Which of the three words above describes what pip just downloaded?
## SPOKEN LINES
- A client wants card payments by Friday and you have never touched payment code. You type npm install stripe, and seconds later your project can take a card.
- - PACKAGE
- - A package is code bundled up with a name, a version number and a list of what it needs, so a tool can download and install it. npm does that for JavaScript, pip does it for Python.
- - Stripe handles the card payment, express handles the routes, and dayjs turns a timestamp into 3 minutes ago.
- - So a package is code boxed up so it can be installed and reused. Tomorrow: Repository, the folder where your whole project and its history live.
## NEXT
Day 19: Repository