dep-parser

module
v0.0.0-...-a89fe16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: MIT

README ΒΆ

dep-parser πŸš€

A powerful and extensible dependency parser for multiple programming languages.

License Build Version


🌟 Features

βœ… Supports multiple package managers (npm, pnpm, yarn, etc.)
βœ… Structured project layout inspired by modern package managers
βœ… Automated test cases & test data
βœ… Highly extensible & developer-friendly

πŸ“¦ Installation

Go Version
go get github.com/khulnasoft/dep-parser
Rust Version
cargo add dep-parser

Or build from source:

cargo build --release

πŸš€ Usage

Rust Example
use dep_parser::rust::cargo::parse::CargoParser;
use dep_parser::types::Parser;
use std::fs::File;

fn main() {
    let mut f = File::open("Cargo.lock").expect("Failed to open file");
    let parser = CargoParser::new();
    let (libs, deps) = parser.parse(&mut f).expect("Failed to parse");
    
    println!("Libraries: {:?}", libs);
    println!("Dependencies: {:?}", deps);
}

πŸ—οΈ Project Structure

This project is now available in both Go and Rust implementations:

  • Go: Original implementation in pkg/ directory
  • Rust: New implementation in src/ directory
Rust Modules
  • types - Core data structures (Library, Dependency, Location, etc.)
  • io - I/O traits and utilities
  • utils - Helper functions for package ID generation, deduplication
  • rust - Rust-specific parsers (Cargo.lock, binary)
  • golang - Go-specific parsers (go.mod, go.sum, binary)
  • nodejs - Node.js parsers (npm, yarn, pnpm)
  • python - Python parsers (pip, poetry, requirements)
  • java - Java parsers (JAR, POM)
  • Other language parsers (php, ruby, dart, dotnet, conda, gradle, hex, julia, sbt, swift, c, frameworks)

πŸ§ͺ Testing

Rust Tests
cargo test
Go Tests
go test ./...

πŸ“ Development Status

  • βœ… Core types and utilities converted to Rust
  • βœ… Rust/Cargo parser fully implemented and tested
  • ⚠️ Other language parsers have placeholder implementations (return "not yet implemented" errors)
  • πŸ”„ Binary parser requires Rust equivalent of go-rustaudit

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL