14 releases (9 breaking)

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

#227 in Web programming

Download history 734/week @ 2024-09-02 576/week @ 2024-09-09 756/week @ 2024-09-16 1725/week @ 2024-09-23 2620/week @ 2024-09-30 706/week @ 2024-10-07 459/week @ 2024-10-14 466/week @ 2024-10-21 444/week @ 2024-10-28 325/week @ 2024-11-04 483/week @ 2024-11-11 883/week @ 2024-11-18 999/week @ 2024-11-25 1033/week @ 2024-12-02 1283/week @ 2024-12-09 1091/week @ 2024-12-16

4,473 downloads per month
Used in 13 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