14 releases (9 breaking)

new 0.10.0 Dec 13, 2024
0.8.0 Dec 6, 2024
0.7.0 Mar 2, 2024
0.6.0 Dec 3, 2023
0.1.1 Feb 21, 2021

#176 in Web programming

Download history 431/week @ 2024-08-23 768/week @ 2024-08-30 600/week @ 2024-09-06 764/week @ 2024-09-13 1427/week @ 2024-09-20 2488/week @ 2024-09-27 1106/week @ 2024-10-04 518/week @ 2024-10-11 496/week @ 2024-10-18 381/week @ 2024-10-25 408/week @ 2024-11-01 476/week @ 2024-11-08 713/week @ 2024-11-15 1154/week @ 2024-11-22 750/week @ 2024-11-29 1214/week @ 2024-12-06

3,954 downloads per month
Used in 12 crates (7 directly)

MIT license

48KB
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.7MB
~35K SLoC