@amrendrasharma/deployguard
v1.0.4
Published
π A lightweight CLI tool that scans your project before deployment and detects common production issues.
Maintainers
Readme
π’ deployguard
A lightweight CLI tool that scans your project before deployment and detects common production issues.
β¨ What it does
Run npx @amrendrasharma/deployguard in any Node.js project before you deploy and get an instant health check:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π’ deployguard v1.0.0 β Pre-deployment project scanner
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Scanning: /Users/you/my-project
β Scanning for console.log statements...
β Checking environment variables...
β Checking for unused dependencies...
β Scanning for large files (> 5MB)...
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Results
β Found 3 console.log statement(s) β remove before deploying
β β src/routes/auth.js:42
β β src/utils/debug.js:7
β β src/utils/debug.js:18
β 2 env var(s) from .env not found in environment:
β β STRIPE_SECRET_KEY is not set
β β SENDGRID_API_KEY is not set
β All dependencies appear to be in use
β 1 large file(s) found β consider adding to .gitignore:
β β assets/promo-video.mp4 (87.3 MB)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Deployment Readiness Score: 62/100
Several issues need attention
[ββββββββββββββββββββββββββββββββββββββββ] 62%
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββπ Quick Start
Run without installing:
npx @amrendrasharma/deployguardOr install globally:
npm install -g @amrendrasharma/deployguard
deployguardScan a specific directory:
deployguard --dir ./my-appπ¦ Installation
# Install globally
npm install -g @amrendrasharma/deployguard
# Or use as a dev dependency
npm install --save-dev @amrendrasharma/deployguardπ Checks Performed
| Check | Points | What it detects |
|-------|--------|-----------------|
| console.log | 25 pts | console.log() statements left in .js, .ts, .jsx, .tsx files |
| Environment Variables | 25 pts | Variables in .env that aren't set in the current environment |
| Unused Dependencies | 25 pts | Packages in package.json that aren't imported anywhere in source code |
| Large Files | 25 pts | Any file over 5MB (accidentally committed assets, DB dumps, etc.) |
Scoring
| Score | Status | |-------|--------| | 90β100 | π Ready to ship! | | 70β89 | β Minor issues to fix | | 50β69 | β Several issues need attention | | 0β49 | β Not ready for deployment |
π§ CLI Options
Options:
-d, --dir <path> Target directory to scan (default: current directory)
--no-color Disable colored output (useful for CI logs)
--debug Show verbose error information
-v, --version Output the current version
-h, --help Show help informationπ Project Structure
deployguard/
βββ bin/
β βββ cli.js # CLI entry point (Commander.js setup, orchestration)
βββ checks/
β βββ consoleCheck.js # Scans for console.log statements
β βββ envCheck.js # Verifies .env variables are set
β βββ dependencyCheck.js # Detects unused npm dependencies
β βββ sizeCheck.js # Finds files larger than 5MB
βββ utils/
β βββ display.js # Terminal output (banner, colors, score display)
β βββ helpers.js # Pure utility functions (formatBytes, truncatePath)
β βββ score.js # Final score calculation
βββ package.json
βββ README.md
βββ .gitignoreποΈ Adding to Your Workflow
npm script (recommended)
Add to your package.json:
{
"scripts": {
"precheck": "deployguard",
"deploy": "deployguard && your-deploy-command"
}
}GitHub Actions
# .github/workflows/deployguard.yml
name: Pre-deploy Check
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
deployguard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npx @amrendrasharma/deployguard --no-colorπ€ Contributing
- Fork the repository: github.com/amrendrasharma1328-a11y/shipcheck
- Create your feature branch:
git checkout -b feat/new-check - Commit your changes:
git commit -m 'feat: add secretsCheck' - Push and open a Pull Request
π¨βπ» Author
Amrendra Sharma
- npm: @amrendrasharma
- GitHub: amrendrasharma1328-a11y
π License
MIT Β© Amrendra Sharma
