A tool to inspect AWS Lambda functions for bad practices and unused files. It specifically detects issues like re-used libraries instantiated inside handler functions and uses Knip to find unused files.
Made with Google Antigravity.
- Bad Practice Detection: Identifies libraries instantiated inside the handler that should be in the global scope for better performance (e.g., AWS SDK clients, database connections).
- Unused File Detection: Integrates with Knip to find files that are not being used in your project.
npx lambda-inspect@latest <path-to-handler>curl -fsSL https://raw.githubusercontent.com/rajikaimal/lambda-inspect/main/install-skill.sh | bashAfter building the project, you can run the CLI using:
$ lambda-inspect <path-to-handler>
$ lambda-inspect <path-to-handler> --skip-unused-files--skip-unused-files: Skip unused files detection (default:false).
- Node.js (>= 22)
- pnpm
Install dependencies:
pnpm install| Command | Description |
|---|---|
pnpm build |
Build the project |
pnpm dev |
Run in development mode with watch |
pnpm test |
Run tests |
pnpm lint |
Run linting (using oxlint) |
pnpm format |
Format code (using oxfmt) |
pnpm knip |
Run Knip analysis |
pnpm scan:secrets |
Scan for secrets using Gitleaks |
pnpm publish |
Publish to NPM (includes scan) |
MIT