11 releases (6 breaking)

0.7.0 Mar 2, 2024
0.6.0 Dec 3, 2023
0.5.0 Apr 16, 2023
0.4.1 Nov 26, 2022
0.1.1 Feb 21, 2021

#284 in Web programming

Download history 86/week @ 2023-12-20 157/week @ 2023-12-27 88/week @ 2024-01-03 215/week @ 2024-01-10 172/week @ 2024-01-17 327/week @ 2024-01-24 347/week @ 2024-01-31 315/week @ 2024-02-07 234/week @ 2024-02-14 281/week @ 2024-02-21 504/week @ 2024-02-28 457/week @ 2024-03-06 286/week @ 2024-03-13 542/week @ 2024-03-20 433/week @ 2024-03-27 318/week @ 2024-04-03

1,651 downloads per month
Used in 10 crates (6 directly)

MIT license

41KB
938 lines

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–1.8MB
~36K SLoC