Rust Dependency Checker

Posted in category Software on
496 Words ~3 Minute Reading Time • Subscribe to receive updates on Software
Eric David Smith
Software Engineer / Musician / Entrepreneur
Rust Dependency Checker by Eric David Smith
Click image to view on GitHub

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

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:

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:

You can view the DOT file using a tool such as Graphviz.

Example Output (report.csv)

File PathDependencyCurrent VersionLatest Version
~/tweetgenai.com/package.json@types/node20.3.120.4.4
~/tweetgenai.com/package.json@types/react18.2.1418.2.15
~/tweetgenai.com/package.json@types/react-dom18.2.618.2.7
~/tweetgenai.com/package.jsoneslint8.43.08.45.0
~/tweetgenai.com/package.jsoneslint-config-next13.4.713.4.12
~/tweetgenai.com/package.jsonhtml-react-parser4.0.04.2.0
~/tweetgenai.com/package.jsonlangchain0.0.960.0.114
~/tweetgenai.com/package.jsonnext13.4.713.4.12
~/tweetgenai.com/package.jsonpostcss8.4.248.4.27
~/tweetgenai.com/package.jsontailwindcss3.3.23.3.3
~/tweetgenai.com/package.jsontypescript5.1.35.1.6

Example Output (dependency_graph.dot)

Rust Dependency Checker by Eric David Smith

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!

Contact


Eric David Smith
Software Engineer / Musician / Entrepreneur
Software

Related Blog Posts

👈 Scroll 👉

Blog Post Tags