depScanner is a lightweight and efficient dependency scanner tool that analyzes lock files (e.g., package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb) and package.json for vulnerabilities. Built with Rust, it helps developers ensure their dependencies are secure and up-to-date.
- Scans lock files for exact dependency versions.
- Supports multiple formats:
package-lock.jsonyarn.lockpnpm-lock.yamlbun.lockb- Fallback to
package.json.
- Identifies known vulnerabilities using public advisory APIs.
- Provides a clean, CLI-friendly vulnerability report.
- Fast and memory-efficient, powered by Rust.
To use depScanner, choose one of the following methods:
If you want to run depScanner natively on your machine, follow these steps:
-
Ensure you have Rust installed.
-
Clone the repository:
git clone https://github.com/your-username/depScanner.git cd depScanner -
Build the project:
cargo build --release
-
Run the binary:
./target/release/depScanner <path-to-lockfile-or-package.json>
For a hassle-free setup, use the Docker image to run depScanner:
-
Build the Docker image:
docker build -t dep-scanner . -
Run the Docker container:
docker run --rm -v $(pwd):/app dep-scanner ./depScanner /app/<lock-file-or-package.json>
Replace
<lock-file-or-package.json>with the path to your dependency file.
Scan a lock file or package.json:
./depScanner <path-to-lockfile-or-package.json>-
Scan a
package-lock.jsonfile:./depScanner ./package-lock.json
-
Scan a
yarn.lockfile:./depScanner ./yarn.lock
-
Scan a
pnpm-lock.yamlfile:./depScanner ./pnpm-lock.yaml
-
Fallback to
package.jsonif lock files are unavailable:./depScanner ./package.json
-
Using Docker to scan a file:
docker run --rm -v $(pwd):/app dep-scanner ./depScanner /app/package-lock.json
The CLI displays a vulnerability report like this:
Dependency Vulnerability Report
Package Version Issues
--------------------------------------------------------------------------------
lodash 4.17.20 Prototype Pollution
express 4.17.1 XSS Vulnerability
chalk 2.4.2 No issues found
- Red: Vulnerable dependencies.
- Green: No vulnerabilities found.
package-lock.json(npm)yarn.lock(Yarn)pnpm-lock.yaml(pnpm)bun.lockb(Bun)package.json(Fallback for declared dependencies)
This project is licensed under the MIT License.
- Built with โค๏ธ using Rust.
- Inspired by the need for secure dependency management.