Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robertohuertasm/yarn-lock-parser
🦀 🙀 Simple yarn.lock parser
https://github.com/robertohuertasm/yarn-lock-parser
parser parser-library rust yarn yarn-lock
Last synced: 2 months ago
JSON representation
🦀 🙀 Simple yarn.lock parser
- Host: GitHub
- URL: https://github.com/robertohuertasm/yarn-lock-parser
- Owner: robertohuertasm
- License: mit
- Created: 2021-02-20T19:43:36.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-02T10:51:22.000Z (10 months ago)
- Last Synced: 2024-10-15T16:16:18.227Z (2 months ago)
- Topics: parser, parser-library, rust, yarn, yarn-lock
- Language: Rust
- Homepage: https://crates.io/crates/yarn-lock-parser
- Size: 360 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yarn-lock-parser
[![ActionsStatus](https://github.com/robertohuertasm/yarn-lock-parser/workflows/Build/badge.svg)](https://github.com/robertohuertasm/yarn-lock-parser/actions) [![Crates.io](https://img.shields.io/crates/v/yarn-lock-parser.svg)](https://crates.io/crates/yarn-lock-parser)
Easily parse `yarn-lock` files (v1 and v2).
## Example
```rust
use std::{error::Error, fs};
use yarn_lock_parser::{parse_str, Entry};fn main() -> Result<(), Box> {
let yarn_lock_text = fs::read_to_string("yarn.lock")?;
let entries: Vec = parse_str(&yarn_lock_text)?;println!("{:?}", entries);
Ok(())
}
```## Documentation
Visit [https://docs.rs/yarn-lock-parser/](https://docs.rs/yarn-lock-parser/)
## Build
You will need [cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html), the Rust package manager.
```bash
cargo build
```## Test
```bash
cargo test
```