Function: removeDependenciesFromPackageJson

removeDependenciesFromPackageJson(tree, dependencies, devDependencies, packageJsonPath?): GeneratorCallback

Remove Dependencies and Dev Dependencies from package.json

For example:

1removeDependenciesFromPackageJson(tree, ['react'], ['jest']); 2

This will remove react and jest from the dependencies and devDependencies sections of package.json respectively.

Parameters

NameTypeDescription
treeTree-
dependenciesstring[]Dependencies to be removed from the dependencies section of package.json
devDependenciesstring[]Dependencies to be removed from the devDependencies section of package.json
packageJsonPath?string-

Returns

GeneratorCallback

Callback to uninstall dependencies only if necessary. undefined is returned if changes are not necessary.