π¦ What is npm?
npm stands for Node Package Manager.
It's the default package manager bundled with Node.js β installing Node automatically gives you npm.
Lets you install, manage, update, and share reusable code, called "packages" or "modules."
π§ Think of it as a massive online registry of libraries and tools built by other developers, ready to plug into your app instead of building everything yourself.
βοΈ What npm Actually Does
Installs packages β pulls code from the npm registry into your project.
Tracks versions β records exactly which version of each package your project uses.
Manages dependencies β handles the web of packages-that-depend-on-other-packages automatically.
Runs scripts β lets you define custom commands (like
npm startornpm run build) inpackage.json.
π€ Why Use npm?
Avoid reinventing the wheel β use
expressinstead of writing a full server from scratch.Share your own libraries β publish your own packages for others (or your future self) to reuse.
Easily manage project dependencies β one file (
package.json) tracks everything your project needs.Stay up to date β update packages and pull in bug fixes or new features with a single command.
π npm Has Three Parts
The registry β the online database where packages live (like
github)The CLI β the
npmcommand you run in your terminal.The website β npmjs.com, where you can browse and search packages.