Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zaczero/yarnlock
yarn.lock file parser
https://github.com/zaczero/yarnlock
lock parser yarn
Last synced: 4 days ago
JSON representation
yarn.lock file parser
- Host: GitHub
- URL: https://github.com/zaczero/yarnlock
- Owner: Zaczero
- License: unlicense
- Created: 2024-09-13T10:32:26.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-10-26T01:44:41.000Z (4 months ago)
- Last Synced: 2025-02-16T22:18:31.887Z (5 days ago)
- Topics: lock, parser, yarn
- Language: Rust
- Homepage: https://pypi.org/p/yarnlock
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yarnlock
[](https://pypi.org/project/yarnlock)
[](https://liberapay.com/Zaczero/)
[](https://github.com/sponsors/Zaczero)Quickly parse yarn dependencies information into a Python dictionary. The output is typed using a TypedDict class, making it more convenient to work with.
## Installation
The recommended installation method is through the PyPI package manager. The project is implemented in Rust and several pre-built binary wheels are available for Linux, macOS, and Windows, with support for both x64 and ARM architectures.
```sh
pip install yarnlock
```## Basic usage
```py
from pathlib import Path
from yarnlock import yarnlock_parseyarnlock_parse(Path('yarn.lock').read_text())
# ->
# {
# '@babel/cli': {
# 'matches': ['^7.24.8'],
# 'dependencies': {
# 'glob': '^7.2.0',
# 'slash': '^2.0.0',
# 'make-dir': '^2.1.0',
# 'commander': '^6.2.0',
# 'convert-source-map': '^2.0.0',
# 'fs-readdir-recursive': '^1.1.0',
# '@jridgewell/trace-mapping': '^0.3.25',
# },
# 'optionalDependencies': {
# 'chokidar': '^3.4.0',
# '@nicolo-ribaudo/chokidar-2': '2.1.8-no-fsevents.3',
# },
# 'version': '7.24.8',
# 'resolved': 'https://registry.npmjs.org/@babel/cli/-/cli-7.24.8.tgz',
# 'integrity': 'sha512-isdp+G6DpRyKc+3Gqxy2rjzgF7Zj9K0mzLNnxz+E/fgeag8qT3vVulX4gY9dGO1q0y+0lUv6V3a+uhUzMzrwXg==',
# },
# ...
# }
```