Rust Dependency Checker
Overview
Dependency Checker is a Rust program that traverses a specified directory, looking for JavaScript projects (those with a package.json
file), checks their npm dependencies and outputs any outdated packages to a CSV report. Additionally, it generates a DOT file representing the dependency graph of the projects.
Features
- Traverses specified directory to find JavaScript projects
- Checks for outdated npm dependencies
- Generates CSV report for outdated dependencies, including current and latest version numbers
- Generates a DOT file representing the dependency graph of the projects
- Skips
node_modules
directories for efficiency
Rust Dependencies
[dependencies]
walkdir = "2.3.2"
serde = { version = "1.0.130", features = ["derive"] }
serde_json = "1.0.67"
reqwest = { version = "0.11.4", features = ["json"] }
csv = "1.1.6"
tokio = { version = "1", features = ["full"] }
semver = "1.0.3"
dot = "0.1.4"
petgraph = "0.6.3"
Installation
Prerequisites:
- Rust and Cargo installed
To install the tool, clone this repository and build the project:
git clone https://github.com/erictherobot/dependency_checker.git
cd dependency_checker
cargo build --release
Usage
After installation, you can run the tool with the directory path as an argument:
cargo run --release /path/to/directory
After running, the tool will generate two files in the project root:
report.csv
: A CSV file containing the report of outdated packages, including the project paths, package names, current versions, and latest versionsdependency_graph.dot
: A DOT file representing the dependency graph of the projects
You can view the DOT file using a tool such as Graphviz.
Example Output (report.csv)
File Path | Dependency | Current Version | Latest Version |
---|---|---|---|
~/tweetgenai.com/package.json | @types/node | 20.3.1 | 20.4.4 |
~/tweetgenai.com/package.json | @types/react | 18.2.14 | 18.2.15 |
~/tweetgenai.com/package.json | @types/react-dom | 18.2.6 | 18.2.7 |
~/tweetgenai.com/package.json | eslint | 8.43.0 | 8.45.0 |
~/tweetgenai.com/package.json | eslint-config-next | 13.4.7 | 13.4.12 |
~/tweetgenai.com/package.json | html-react-parser | 4.0.0 | 4.2.0 |
~/tweetgenai.com/package.json | langchain | 0.0.96 | 0.0.114 |
~/tweetgenai.com/package.json | next | 13.4.7 | 13.4.12 |
~/tweetgenai.com/package.json | postcss | 8.4.24 | 8.4.27 |
~/tweetgenai.com/package.json | tailwindcss | 3.3.2 | 3.3.3 |
~/tweetgenai.com/package.json | typescript | 5.1.3 | 5.1.6 |
Example Output (dependency_graph.dot)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
If you find this useful as is please let me know. If you find any bugs, please feel free to submit a pull request or open an issue. If you have any questions, you can contact me.
Supporting My Work
Please consider Buying Me A Coffee. I work hard to bring you my best content and any support would be greatly appreciated. Thank you for your support!