15 releases (breaking)

0.11.0 Feb 6, 2025
0.10.0 Dec 13, 2024
0.9.0 Dec 8, 2024
0.7.0 Mar 2, 2024
0.1.1 Feb 21, 2021

#189 in Web programming

Download history 353/week @ 2024-10-26 419/week @ 2024-11-02 484/week @ 2024-11-09 803/week @ 2024-11-16 1069/week @ 2024-11-23 899/week @ 2024-11-30 1248/week @ 2024-12-07 1185/week @ 2024-12-14 619/week @ 2024-12-21 871/week @ 2024-12-28 1786/week @ 2025-01-04 1253/week @ 2025-01-11 1170/week @ 2025-01-18 1568/week @ 2025-01-25 1643/week @ 2025-02-01 1676/week @ 2025-02-08

6,296 downloads per month
Used in 13 crates (7 directly)

MIT license

49KB
1K SLoC

yarn-lock-parser

ActionsStatus Crates.io

Easily parse yarn-lock files (v1 and v2).

Example

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)?;

    println!("{:?}", entries);

    Ok(())
}

Documentation

Visit https://docs.rs/yarn-lock-parser/

Build

You will need cargo, the Rust package manager.

cargo build

Test

cargo test

Dependencies

~1–1.6MB
~33K SLoC