Skip to content

Convert package-validator.js to Bash, deprecate npm-install-monitor.js#38

Merged
virtualian merged 1 commit into
mainfrom
refactor/36-convert-js-to-bash
Dec 7, 2025
Merged

Convert package-validator.js to Bash, deprecate npm-install-monitor.js#38
virtualian merged 1 commit into
mainfrom
refactor/36-convert-js-to-bash

Conversation

@virtualian

Copy link
Copy Markdown
Owner

Summary

  • Convert scripts/package-validator.js to pure Bash implementation
  • Deprecate scripts/npm-install-monitor.js (not integrated, limited value)
  • Achieve single-language codebase (all Bash)

Changes

  • New: scripts/package-validator.sh - Pure Bash implementation with:
    • Levenshtein distance algorithm for typosquatting detection
    • Reuses npm-audit-lib.sh functions for email validation and caching
    • Bash 3 compatible (works on macOS default bash)
    • Adds --json output flag
  • Moved: scripts/package-validator.jsdeprecated/
  • Moved: scripts/npm-install-monitor.jsdeprecated/
  • Updated: npm-scanner.sh to call .sh instead of .js
  • Updated: Documentation for both scripts
  • Updated: CLAUDE.md architecture section

Test plan

  • ./npm-scanner.sh validate express - SAFE, trusted domain detected
  • ./npm-scanner.sh validate lodash --json - Valid JSON output
  • ./npm-scanner.sh validate expres - Typosquatting detected (edit distance: 1)
  • ./npm-scanner.sh validate @types/node - Scoped package works
  • ./npm-scanner.sh validate nonexistent-xyz - Error, exit 1
  • ./npm-scanner.sh validate esbuild - Install scripts detected

Closes #36

…s (issue #36)

- Create scripts/package-validator.sh with pure Bash implementation
  - Levenshtein distance algorithm for typosquatting detection
  - Reuses npm-audit-lib.sh functions for email validation and caching
  - Bash 3 compatible (works on macOS default bash)
  - Adds --json output flag
- Move scripts/package-validator.js to deprecated/
- Move scripts/npm-install-monitor.js to deprecated/
- Update npm-scanner.sh to call package-validator.sh
- Update documentation for both scripts
- Update CLAUDE.md architecture section

Closes #36
@virtualian virtualian merged commit 630bb2f into main Dec 7, 2025
1 check passed
@virtualian virtualian deleted the refactor/36-convert-js-to-bash branch December 8, 2025 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert package-validator.js to Bash and deprecate npm-install-monitor.js

1 participant