yarn-lock-parser

Crates.ioyarn-lock-parser
lib.rsyarn-lock-parser
version0.7.0
sourcesrc
created_at2021-02-20 23:38:14.842153
updated_at2024-03-02 10:51:37.732048
descriptionyarn.lock parser
homepage
repositoryhttps://github.com/robertohuertasm/yarn-lock-parser
max_upload_size
id358239
size42,526
Roberto Huertas (robertohuertasm)

documentation

README

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
Commit count: 17

cargo fmt