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

#184 in Parser implementations

Download history 701/week @ 2024-12-25 1368/week @ 2025-01-01 1448/week @ 2025-01-08 1156/week @ 2025-01-15 1478/week @ 2025-01-22 1490/week @ 2025-01-29 1845/week @ 2025-02-05 1671/week @ 2025-02-12 1370/week @ 2025-02-19 1866/week @ 2025-02-26 2140/week @ 2025-03-05 2000/week @ 2025-03-12 2006/week @ 2025-03-19 1967/week @ 2025-03-26 1863/week @ 2025-04-02 1488/week @ 2025-04-09

7,695 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