9 unstable releases (4 breaking)

0.5.0 Apr 16, 2023
0.4.1 Nov 26, 2022
0.4.0 Oct 30, 2022
0.3.2 Jul 17, 2022
0.1.1 Feb 21, 2021

#245 in Parser implementations

Download history 213/week @ 2023-02-05 312/week @ 2023-02-12 313/week @ 2023-02-19 219/week @ 2023-02-26 165/week @ 2023-03-05 214/week @ 2023-03-12 290/week @ 2023-03-19 171/week @ 2023-03-26 71/week @ 2023-04-02 82/week @ 2023-04-09 316/week @ 2023-04-16 173/week @ 2023-04-23 182/week @ 2023-04-30 244/week @ 2023-05-07 143/week @ 2023-05-14 271/week @ 2023-05-21

841 downloads per month
Used in 6 crates (3 directly)

MIT license

38KB
871 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
~39K SLoC