npm
Overview
npm is the default package manager for Node.js and also refers to the public package registry widely used in JavaScript and frontend ecosystems.
It matters because npm is central to installing dependencies, running project scripts, publishing packages, and coordinating JavaScript build workflows.
What npm Covers
The term npm usually refers to two closely related things:
- the npm CLI used from the command line
- the npm package registry where packages are published and installed from
In daily project work, npm is often the layer that connects a JavaScript or TypeScript codebase to its dependencies, scripts, and automation tasks.
Common npm Tasks
npm is commonly used to:
- install dependencies
- add or remove packages
- run project scripts
- publish packages
- manage versioned dependency trees through
package.jsonand lockfiles
That makes npm a central part of js, ts, frontend, and build-tool workflows.
package.json and Scripts
Most npm-based projects define behavior in package.json.
That file commonly includes:
- dependency declarations
- script commands such as
build,start, ortest - package metadata
- engine or workspace settings
In practice, many teams use npm scripts as the standard entry point for local development and CI commands.
npm vs Node.js
npm is closely associated with Node.js, but they are not identical.
- Node.js is the JavaScript runtime.
- npm is the package manager and registry ecosystem commonly bundled with it.
When people say a project "uses npm," they usually mean its dependencies and scripts are managed through the npm workflow.
Frequently Asked Questions
Is npm only for frontend projects?
No. It is common in frontend work, but it is also used for backend services, tooling, CLIs, static-site projects, and fullstack applications built on Node.js.
Does npm always install from the public registry?
No. Teams can use private registries, local packages, workspaces, or direct package sources depending on their setup.
Is npm the same as Node.js?
No. npm is the package manager ecosystem; Node.js is the runtime it most commonly works with.
Resources
- Website: npm
- Docs: npm Docs
- CLI: CLI Commands
- Workspaces: Using npm Workspaces
- Source: npm CLI Repository