Node.js 24 cheatsheet
Node.js 24: Packages with npm
12 common Node.js 24 tasks.
Add a development dependency
Install a package that is only needed while developing, such as a linter or test tool.
npm install --save-dev typescript
Install exactly what the lockfile says
Delete node_modules and install from package-lock.json. Use it in CI.
npm ci
Caution: Removes the existing node_modules folder, and fails if package.json and the lockfile disagree.
List top-level dependencies
Show the installed packages without their nested dependencies.
npm ls --depth=0
Run a package without installing it
Run a package's command from the registry or from node_modules/.bin.
npx prettier --write .
Switch the project to ES modules
Set "type": "module" in package.json so .js files use import and export.
npm pkg set type=module