npm Audit & Package Maintenance

Security auditing, package maintenance, and npm org/team workflows.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Audit and security
Run audit
npm audit

# Audit installed dependencies for known vulnerabilities.

Audit as JSON
npm audit --json

# Emit machine-readable audit results.

Automatically fix audit issues
npm audit fix

# Apply compatible fixes for known vulnerabilities.

Force risky audit fixes
npm audit fix --force

# Apply broader updates that may include breaking changes.

Show outdated dependencies
npm outdated --all

# Include transitive packages where supported.

## Package maintenance
List top-level packages only
npm ls --depth=0

# Show only direct dependencies.

Diff a package version
npm diff <package>@1.0.0 <package>@2.0.0

# Compare package contents between versions.

Explain one dependency
npm explain lodash

# Inspect why one package is present.

Rebuild one package
npm rebuild <package>

# Re-run build scripts for one installed package.

Star a package
npm star <package>

# Favorite a package on the registry.

Unstar a package
npm unstar <package>

# Remove a favorite from your account.

## Org and team operations
List org members
npm org ls <org>

# List users in an npm organization.

Change org user role
npm org set <org>:<user> developer

# Set an organization role for a user.

Create a team
npm team create <org>:developers

# Create a team in an npm organization.

Add a user to a team
npm team add <org>:developers <user>

# Add a user to a team.

Remove a user from a team
npm team rm <org>:developers <user>

# Remove a user from a team.

Recommended next

No recommendations yet.