What is npm?
The world's biggest library of code
⏱ Est. ~4 min
01 · Read
When you installed Node.js, you also got a tool called npm — Node Package Manager.
npm is like an app store, except the apps are code. Instead of downloading apps to your phone, you download packages (reusable code) into your project. Need to build a web server? There's a package. Need to handle dates? There's a package. Need to send email? Package.
Instead of writing everything from scratch, engineers stand on the shoulders of millions of other engineers — who share their work for free.
💡 Picture thisnpm is like a giant Lego store. Instead of molding every brick yourself, you grab ready-made pieces and snap them together to build something new.
02 · Read
The npm registry has over 2 million packages — and growing every day. Here are some popular ones you'll run into:
Key points
- express — build web servers (over 30 million weekly downloads)
- axios — make HTTP requests to other servers or APIs
- dayjs — handle dates and times without losing your mind
- chalk — add color to terminal output
03 · Quiz
What is npm?
- A programming language
- A package manager that lets you install reusable code libraries
- A text editor for writing code
- A website for hosting your projects
04 · Fill in the blank
npm stands for Node _____ Manager.
05 · Read
As an engineer, you'll use npm constantly. The two most common commands:- npm install <package> — download a package into your project - npm init — set up a new project
Next lesson, we'll use them.
Key points
- npm install downloads a package from the registry
- npm init creates a new project setup
- Every Node.js project has a package.json listing its packages
06 · Fill in the blank
To download a package called chalk into your project, you'd run npm _____ chalk.
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.