{"id":20980402,"url":"https://github.com/mindscreen/yarnlock","last_synced_at":"2025-08-25T07:09:05.561Z","repository":{"id":57017170,"uuid":"122258815","full_name":"mindscreen/yarnlock","owner":"mindscreen","description":"A php-package for parsing and evaluating the yarn.lock format","archived":false,"fork":false,"pushed_at":"2024-10-25T12:20:01.000Z","size":61,"stargazers_count":4,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-30T09:00:00.980Z","etag":null,"topics":["lockfile","yarn"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mindscreen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-20T21:31:06.000Z","updated_at":"2024-12-23T19:10:46.000Z","dependencies_parsed_at":"2024-06-19T01:40:35.476Z","dependency_job_id":"c2a38326-f3fb-4075-bb02-1c0c608d45b4","html_url":"https://github.com/mindscreen/yarnlock","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"e4308b9260f128c0db8de073f133f38e2db66eb3"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mindscreen/yarnlock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindscreen%2Fyarnlock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindscreen%2Fyarnlock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindscreen%2Fyarnlock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindscreen%2Fyarnlock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mindscreen","download_url":"https://codeload.github.com/mindscreen/yarnlock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindscreen%2Fyarnlock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272020442,"owners_count":24859820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lockfile","yarn"],"created_at":"2024-11-19T05:28:19.991Z","updated_at":"2025-08-25T07:09:05.506Z","avatar_url":"https://github.com/mindscreen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mindscreen\\YarnLock\n\n[![CircleCI](https://circleci.com/gh/mindscreen/yarnlock/tree/master.svg?style=svg)](https://circleci.com/gh/mindscreen/yarnlock/?branch=master)\n[![codecov](https://codecov.io/gh/mindscreen/yarnlock/branch/master/graph/badge.svg?token=HSF16OGPyr)](https://app.codecov.io/gh/mindscreen/yarnlock/branch/master)\n\n\nA php-package for parsing and evaluating the [yarn.lock](https://yarnpkg.com/lang/en/docs/yarn-lock/) format.\n\n## Basic Usage\n```php\n\u003c?php\nuse Mindscreen\\YarnLock;\n\n$yarnLock = YarnLock::fromString(file_get_contents('yarn.lock'));\n\n$allPackages = $yarnLock-\u003egetPackages();\n$hasBabelCore = $yarnLock-\u003ehasPackage('babel-core', '^6.0.0');\n$babelCorePackages = $yarnLock-\u003egetPackagesByName('babel-core');\n$babelCoreDependencies = $babelCorePackages[0]-\u003egetDependencies();\n```\n\n## Package Depth\nIf you maybe don't just want all packages but only the direct dependencies plus one level of indirection, you have to go a little extra mile:\n```php\n\u003c?php\nuse Mindscreen\\YarnLock;\n// read the dependencies from the package.json file\n$packageDependencies = (json_decode(file_get_contents('package.json')))-\u003edependencies;\n// get these packages from the yarn lock-file\n$rootDependencies = array_map(function($packageName, $packageVersion) use ($yarnLock) {\n    return $yarnLock-\u003egetPackage($packageName, $packageVersion);\n}, array_keys($packageDependencies), array_values($packageDependencies));\n// some of our dependencies might be used by other dependencies deeper down the tree so\n// they wouldn't appear in the top levels, if we wouldn't explicitly set them there.\n$yarnLock-\u003ecalculateDepth($rootDependencies);\n\n// get the first two levels; the second argument is the exclusive upper limit\n$yarnLock-\u003egetPackagesByDepth(0, 2);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindscreen%2Fyarnlock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmindscreen%2Fyarnlock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindscreen%2Fyarnlock/lists"}