| name | npm |
| description | npm commands for package management and scripts |
| argument-hint | [command or question] |
| allowed-tools | Bash, Read |
Help with npm based on $ARGUMENTS.
Package Management
npm init
npm init -y
npm install
npm install lodash
npm install -D typescript
npm install lodash@4.17.21
npm i
npm i -D
npm uninstall lodash
npm rm lodash
npm update
npm update lodash
npm outdated
Scripts
npm run build
npm run test
npm run dev
npm test
npm start
npm stop
npm run build -- --watch
Package Info
npm view lodash
npm view lodash versions
npm list
npm list --depth=0
npm list -g
npm root
npm root -g
Versioning
npm version patch
npm version minor
npm version major
Publishing
npm login
npm publish
npm publish --access public
npm unpublish pkg@1.0.0
Configuration
npm config list
npm config get registry
npm config set registry https://registry.npmjs.org/
Useful Commands
npm ci
npm audit
npm audit fix
npm cache clean --force
npm link
npm link package-name
package.json Scripts Example
{
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"test": "vitest",
"lint": "eslint src/",
"format": "prettier --write src/"
}
}