Deps updates your package.json dependencies to their latest version.
Deps updates both dependencies and devDependencies by default. You can choose to update only production or development dependencies.
Where a dependency has an exact version, Deps does not update that dependency by default. Deps can be configured to update to an exact version or to latest as an exact version.
Globally:
npm i -g @modernpoacher/depsTo your project:
npm i -D @modernpoacher/depsWhen installed globally, change into the root directory of the package you want to update and execute the command:
depsWhen installed locally, or not installed, use npx:
npx @modernpoacher/depsAlternatively, use npm with a script target in your project's package.json:
{
"scripts": {
"deps": "deps"
}
}Then:
npm run depsTo update only production dependencies (on the dependencies field):
deps --save-prod # or -POr:
npx @modernpoacher/deps --save-prod # or -POr:
npm run deps -- --save-prod # or -PTo update only development dependencies (dependencies on the devDependencies field):
deps --save-dev # or -DOr:
npx @modernpoacher/deps --save-dev # or -DOr:
npm run deps -- --save-dev # or -DTo configure Deps create a file named .depsrc in the root directory of the package you want to update.
It should contain JSON and be structured as package.json:
{
"dependencies": {
"express": "5.0.0-alpha.8"
},
"devDependencies": {
"gulp": "latest"
}
}Add an author field to .depsrc:
{
"author": "Jonathan Perry <[email protected]>"
}Instruct Deps not to update your package with an ignore field in .depsrc:
{
"ignore": true
}Without a .depsrc configuration file, whenever Deps encounters an exact version, it will assume that an exact version should not be updated.
The .depsrc configuration file enables this behaviour to be changed.
In the example above, the dependencies field defines express with an exact version while devDependencies defines gulp with latest.
With the .depsrc configuration file as the example above:
- If
package.jsondefinesexpressat version5.0.0-alpha.7then Deps will upgrade to5.0.0-alpha.8 - If
package.jsondefines5.0.0-alpha.8then Deps will not update the version at all (in which case, the entry in.depsrcis meaningless and can be deleted) - If
package.jsondefines5.0.0-alpha.9then Deps will downgrade to5.0.0-alpha.8. (If the entry in.depsrcis out of date, change the entry, or delete it)
Deps only refers to the .depsrc configuration file when it encounters an exact version in package.json. If there is no entry for that dependency in the .depsrc configuration file then Deps will not upgrade, downgrade or otherwise modify it.
You need not duplicate an exact version in .depsrc. (Let package.json be the source of truth.)
Typically, an entry in the .depsrc configuration file will contain latest.
Again, with the .depsrc configuration file as the example above:
- If
package.jsondefinesgulpat version4.0.2then Deps will update to the latest version
deps \
--save-prod \ # Boolean
--save-dev \ # Boolean
--save-optional \ # Boolean
--save-bundle \ # Boolean
--registry '<REGISTRY>' \
--force # Boolean
deps-execute \
--path '<PATH>' \
--from '<FROM>' \
--only '<ONLY>' \
--registry '<REGISTRY>' \
--force \ # Boolean
--message '<MESSAGE>' \
--author '<AUTHOR>'
deps-install \
--prod \ # Boolean
--dev \ # Boolean
--optional \ # Boolean
--bundle \ # Boolean
--peer \ # Boolean
--save \ # Boolean
--registry '<REGISTRY>' \
--force # Boolean
deps-deps \
--path . \
--from . \
--only .
deps-wipe --path .
deps-push --path .
deps-head --path .npm run deps -- \
--save-prod \ # Boolean
--save-dev \ # Boolean
--save-optional \ # Boolean
--save-bundle \ # Boolean
--registry '<REGISTRY>' \
--force # Boolean
npm run deps-execute -- \
--path '<PATH>' \
--from '<FROM>' \
--only '<ONLY>' \
--registry '<REGISTRY>' \
--force \ # Boolean
--message '<MESSAGE>' \
--author '<AUTHOR>'
npm run deps-install -- \
--prod \ # Boolean
--dev \ # Boolean
--optional \ # Boolean
--bundle \ # Boolean
--peer \ # Boolean
--save \ # Boolean
--registry '<REGISTRY>' \
--force # Boolean
npm run deps-deps -- \
--path . \
--from . \
--only .
npm run deps-wipe -- --path .
npm run deps-push -- --path .
npm run deps-head -- --path .