find-dupes.js 889 B

123456789101112131415161718192021222324252627282930313233343536
  1. // dedupe duplicated packages, or find them in the tree
  2. const ArboristWorkspaceCmd = require('./workspaces/arborist-cmd.js')
  3. class FindDupes extends ArboristWorkspaceCmd {
  4. /* istanbul ignore next - see test/lib/load-all-commands.js */
  5. static get description () {
  6. return 'Find duplication in the package tree'
  7. }
  8. /* istanbul ignore next - see test/lib/load-all-commands.js */
  9. static get name () {
  10. return 'find-dupes'
  11. }
  12. /* istanbul ignore next - see test/lib/load-all-commands.js */
  13. static get params () {
  14. return [
  15. 'global-style',
  16. 'legacy-bundling',
  17. 'strict-peer-deps',
  18. 'package-lock',
  19. 'omit',
  20. 'ignore-scripts',
  21. 'audit',
  22. 'bin-links',
  23. 'fund',
  24. ...super.params,
  25. ]
  26. }
  27. exec (args, cb) {
  28. this.npm.config.set('dry-run', true)
  29. this.npm.commands.dedupe([], cb)
  30. }
  31. }
  32. module.exports = FindDupes