What is npm?

Answer

npm (Node Package Manager) is the default package manager for Node.js and the world's largest software registry, hosting over 2 million packages. It serves two roles: (1) a CLI tool for installing, updating, and managing JavaScript packages and their dependencies, and (2) an online registry at npmjs.com where developers publish and share packages. npm comes bundled with Node.js. Key commands: npm install <package> — installs a package locally; npm install -g <package> — installs globally; npm init — creates a package.json; npm run <script> — runs a script defined in package.json; npm update — updates packages. Alternatives to npm include Yarn and pnpm, which offer faster installation and better monorepo support.