| Crates.io | yarn-lock-parser |
| lib.rs | yarn-lock-parser |
| version | 0.13.0 |
| created_at | 2021-02-20 23:38:14.842153+00 |
| updated_at | 2026-01-11 15:27:55.210062+00 |
| description | yarn.lock parser |
| homepage | |
| repository | https://github.com/robertohuertasm/yarn-lock-parser |
| max_upload_size | |
| id | 358239 |
| size | 63,127 |
A fast and reliable parser for yarn.lock files written in Rust. Supports all yarn.lock versions (v1, v2, and later). Parse lock files into structured data for dependency analysis, validation, and programmatic access.
thiserrorAdd this to your Cargo.toml:
[dependencies]
yarn-lock-parser = "0.13"
use std::{error::Error, fs};
use yarn_lock_parser::{parse_str, Entry};
fn main() -> Result<(), Box<dyn Error>> {
let yarn_lock_text = fs::read_to_string("yarn.lock")?;
let entries: Vec<Entry> = parse_str(&yarn_lock_text)?;
for entry in entries {
println!("{:?}", entry);
}
Ok(())
}
API documentation is available on docs.rs
cargo)cargo build
cargo test
cargo test -- --nocapture
MIT