NPM Skill
Use the npm tool to manage Node.js packages and run npm workflows.
Common workflows
Install dependencies
code
npm tool: action=install npm tool: action=install, args="express @types/express --save-dev"
Run scripts
code
npm tool: action=run, args="dev" npm tool: action=test npm tool: action=build
Publish a package
Always do a dry run first to verify what will be published:
code
npm tool: action=publish, dry_run=true
Then publish for real:
code
npm tool: action=publish npm tool: action=publish, args="--tag beta"
Version bumps
Preview first, then apply:
code
npm tool: action=version, args="patch", dry_run=true npm tool: action=version, args="minor"
Check for issues
code
npm tool: action=outdated npm tool: action=audit npm tool: action=audit, args="--fix"
Inspect packages
code
npm tool: action=info, args="react" npm tool: action=list, args="--depth=0"
Guidelines
- •Before publishing, always read
package.jsonto verify name, version, files, and registry config. - •Use
dry_run: truefor publish, pack, and version to preview before committing. - •Check
npm outdatedbefore updating to understand what will change. - •Run
npm auditafter installing new dependencies. - •When working in a monorepo, use the
pathparameter to target specific packages.