docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a command-line tool that installs npm packages with automatic peer dependency resolution and conflict detection.
Create a utility that wraps package installation functionality to handle peer dependencies intelligently. The tool should install requested packages while automatically resolving peer dependencies, detecting conflicts, and providing clear feedback to the user.
The tool should support the following operations:
When installing packages:
The tool should display:
/**
* Installs packages with peer dependency resolution.
*
* @param {Array<string>} packages - Array of package names to install
* @param {Object} options - Installation options
* @param {boolean} options.autoInstallPeers - Automatically install peer dependencies
* @param {boolean} options.strictPeerDependencies - Fail on peer dependency conflicts
* @param {string} options.dir - Directory to install packages in
* @returns {Promise<Object>} Installation result
* @returns {Promise<Array>} result.installed - List of installed packages
* @returns {Promise<Array>} result.peerWarnings - Warnings about peer dependencies
* @returns {Promise<Array>} result.conflicts - List of peer dependency conflicts
* @returns {Promise<boolean>} result.success - Whether installation succeeded
*/
async function installWithPeers(packages, options = {}) {
// Implementation here
}
module.exports = { installWithPeers };Provides package management functionality and metadata access for analyzing peer dependencies.