What it is
npm is the package manager that ships with Node.js. It installs JavaScript libraries from the npm registry, the largest public collection of open source packages, and records exact versions in a lock file so every machine installs the same thing. The npx command that comes with it runs a package's tool without installing it globally. Alternatives such as Yarn and pnpm read the same registry.
It is also a task runner. A project's package.json can define scripts for building, testing and deploying, and npm run executes them. That makes it the common entry point for nearly every JavaScript project, whether the code ends up in a browser, on a phone or on a server. npm, Inc. is owned by GitHub.
How I use it
- Runs the builds for the React web app and customer portal behind Rental Pilot.
- Manages the Node and Express API, React and Vite front end of Lend Pilot.
- Builds the React Native field app, alongside the Expo and Xcode tools.
- Sits under the Node server that powers the Ask my agent page on this site.
npm is the right tool for anything built on Node.js or a modern JavaScript front end. I reach for it because it puts the build, the test and the deploy behind the same few commands in every project, which makes the projects easier to hand to a script or an agent.
Questions
What JavaScript stack does Shawn Mervin use?
React and Vite in front, Node, Express and PostgreSQL behind for Lend Pilot, and React Native for Rental Pilot's field app. npm installs and builds all of it.
Why does a lock file matter?
It pins the exact version of every dependency, so a build on my machine, a server or an agent matches the one that was tested.