Convert yarn.lock to package-lock.json and vice versa, using node_modules to ensure accurate dependency translation.
Synp is a Node.js command-line tool and library that converts between Yarn's yarn.lock and npm's package-lock.json lockfiles. It solves the problem of dependency lockfile incompatibility when switching between package managers or collaborating in mixed npm/Yarn environments. The tool uses the existing node_modules directory to ensure accurate version resolution during conversion.
JavaScript/Node.js developers, teams, or projects that use both npm and Yarn, or are migrating between them. It's particularly useful for maintaining consistent dependencies across different package managers.
Developers choose Synp because it provides reliable, bidirectional lockfile conversion where native tools may be limited (e.g., Yarn's import command only handles one direction). Its node_modules-based approach ensures practical accuracy, and it offers both CLI and programmatic APIs for flexibility.
Convert yarn.lock to package-lock.json and vice versa
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Converts both yarn.lock to package-lock.json and vice versa, filling the gap where Yarn's import only handles one direction, as noted in the README's command line usage section.
Leverages the existing node_modules directory to resolve version mismatches, ensuring practical conversion accuracy by relying on real package states rather than theoretical lockfile parsing.
Provides npmToYarn() and yarnToNpm() functions for seamless use in build scripts or custom tools, offering flexibility beyond CLI usage.
Includes specific guidance for checksum issues, such as using yarn's --update-checksums flag or deleting npm's integrity fields, detailed in the caveats and troubleshooting sections.
Converting to yarn.lock can result in corrupted checksums due to npm's sha-512 support, requiring manual fixes like --update-checksums or integrity deletion, as admitted in the caveats.
Explicitly does not 'play well' with bundled dependencies, which may lead to inaccurate conversions unless packages are reinstalled, as warned in the caveats section.
Accuracy suffers for optional dependencies not installed on the converting platform, forcing conversions to be done on specific systems or requiring manual updates, similar to npm's historical issues.
For package-lock.json to yarn.lock conversion, Yarn's built-in 'import' command (since 1.7.0) makes synp unnecessary, reducing its value in common migration scenarios.