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

#337 in Web programming

Download history 253/week @ 2024-01-22 311/week @ 2024-01-29 353/week @ 2024-02-05 288/week @ 2024-02-12 258/week @ 2024-02-19 472/week @ 2024-02-26 474/week @ 2024-03-04 259/week @ 2024-03-11 531/week @ 2024-03-18 434/week @ 2024-03-25 421/week @ 2024-04-01 413/week @ 2024-04-08 631/week @ 2024-04-15 401/week @ 2024-04-22 628/week @ 2024-04-29 567/week @ 2024-05-06

2,255 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.2–1.8MB
~38K SLoC