src/npm.js
function runYarn(deps, options, exec) {
	options = options || {};
	exec = exec || spawnSync;

	const add = options.dev ? ['add', '--dev'] : ['add'];
	const remove = ['remove'];
	const args = (options.remove ? remove : add).concat(deps);

	return exec('yarn', args, {
		stdio: options.stdio === undefined ? 'inherit' : options.stdio,
		cwd: options.cwd,
	});
}
function runYarn(deps, options, exec) {
	options = options || {};
	exec = exec || spawnSync;

	const add = options.dev ? ['add', '--dev'] : ['add'];
	const remove = ['remove'];
	const args = (options.remove ? remove : add).concat(deps);

	return exec('yarn', args, {
		stdio: options.stdio === undefined ? 'inherit' : options.stdio,
		cwd: options.cwd,
	});
}
function runYarn ( deps , options , exec ) { options = options || { } ; exec = exec || spawnSync ; const add = options . dev ? [ 'add' , '--dev' ] : [ 'add' ] ; const remove = [ 'remove' ] ; const args = ( options . remove ? remove : add ) . concat ( deps ) ; return exec ( 'yarn' , args , { stdio : options . stdio === undefined ? 'inherit' : options . stdio , cwd : options . cwd , } ) ; }
Install given Yarn packages

@param {Array|string} deps
@param {Object} [options]
@param {boolean} [options.dev=true] --dev (production by default)
@param {boolean} [options.remove=false] uninstall package (install by default)
@param {Function} [exec]
@return {Object}
Install given Yarn packages