Skip to main content

Migrating from npm-check

npm-check reports unused dependencies and out-of-date packages, with an interactive updater. rev-dep replaces its unused-dependency analysis and adds checks npm-check doesn't have.

Why migrate​

What carries over, what changes​

  • Covered well: unused dependencies.
  • Out of scope - version updates. npm-check's main extra feature is checking for outdated packages and updating them interactively (-u). rev-dep does not manage versions; keep npm outdated or npm-check-updates for that.
  • Bonus: rev-dep adds missing-dependency detection, which npm-check does not focus on.

Feature mapping​

npm-checkrev-dep
unused dependenciesunusedNodeModulesDetection
-i, --ignore <glob>excludeModules
-p, --production (skip devDependencies)enable checks on production entry points; see dev-deps in production
-u / -y (update outdated packages)- (out of scope; use npm outdated / npm-check-updates)
-missingNodeModulesDetection

Translating your usage​

npm-check
npm-check --ignore "@types/*"

become a rev-dep.config.jsonc:

{
"rules": [
{
"path": ".",
"unusedNodeModulesDetection": {
"enabled": true,
"excludeModules": ["@types/*"]
},
"missingNodeModulesDetection": {
"enabled": true
}
}
]
}

Tooling-only packages that aren't imported (CLIs, plugins) can be pointed to with pkgJsonFieldsWithBinaries / filesWithBinaries / filesWithModules rather than excluded - see unused node modules.

Running it​

# npm-check
npx npm-check

# rev-dep
rev-dep config run

Next steps​