- What is mindscreen/yarnlock used for?
- mindscreen/yarnlock is a PHP package for parsing and evaluating the yarn.lock file format. It is useful when you need to inspect resolved package versions or dependency data from a Yarn lockfile inside PHP code. In Laravel projects, it can support tooling, audits, or build-time checks without requiring Node.js.
- How do I install mindscreen/yarnlock with Composer?
- Install the package with Composer using composer require mindscreen/yarnlock. This adds it to your project's composer.json and installs it into the vendor directory. Then include Composer's autoloader, which Laravel already does, before using the package classes.
- Does mindscreen/yarnlock work with Laravel?
- Yes, it can be used in Laravel because it is a PHP package installed through Composer and loaded by Laravel's autoloader. It does not need to be a Laravel-specific service provider for basic parsing use. You can call it from commands, jobs, tests, or application services where lockfile inspection is needed.
- Which Laravel and PHP versions are supported?
- The package is a PHP library rather than a Laravel framework component, so Laravel version support mainly depends on your PHP version and Composer constraints. Check the package's composer.json for its required PHP version and any dependency limits. If your Laravel application runs a compatible PHP version, the parser should be usable there.
- How do I parse a yarn.lock file in PHP?
- Typical usage is to point the package parser at your project's yarn.lock file and read the resulting package or dependency data. The exact class names and method signatures should be confirmed in the package README or source. Keep the yarn.lock path configurable so it works in local, CI, and production build environments.
- Can I inspect resolved package versions and dependencies?
- The package is intended for parsing and evaluating yarn.lock data, which includes resolved package versions and dependency information. You can use that data for audits, reporting, or build checks. The exact structure returned should be verified against the package API before relying on it in production code.
- Is there any configuration required for mindscreen/yarnlock?
- There is no application-level configuration described for this package. Most usage is likely limited to providing the yarn.lock file path or contents to the parser and reading the parsed result. Check the README for constructor options or evaluator settings if your version exposes them.
- How should I test code that uses mindscreen/yarnlock?
- Use a small fixture yarn.lock file with known package versions and dependency entries, then assert that your code reads the expected values. This avoids depending on a real project lockfile that changes frequently. If the parser accepts strings, you can also test with inline lockfile content.
- Is mindscreen/yarnlock safe and performant in production?
- Parsing a yarn.lock file is usually a build-time or maintenance task, not something to run on every web request. For production use, treat lockfiles as input data and avoid parsing untrusted files during user requests. Very large lockfiles can consume memory, so run such checks in CI, queue workers, or commands where resource use is controlled.
- What alternatives exist to mindscreen/yarnlock, and how is it maintained?
- Alternatives include Yarn's own CLI tools such as yarn list or yarn why, Node.js lockfile parsers, or writing custom parsing logic for yarn.lock. mindscreen/yarnlock is useful when you specifically want to inspect yarn.lock data from PHP or Laravel without invoking Node.js. For maintenance status, check Packagist, the repository activity, open issues, and the latest release before adopting it.