Is there a way to run npm prune but a single package that is not in the dependencies?
I know it sounds weird, but there is a legit use-case.
Use case:
- Inside an abstracted CI/CD flow, I want to
npm installany new additions to thepackage.json - Then
npm pruneshould remove any extraneous packages that may have been removed from thepackage.json - Then I want to
npm install XXXXa single dependency that is required only for the CI/CD flow, however subsequent flows should not install this if it is already present, thus on the second execution of the CI/CD flow, thisXXXXpackage would be removed via thenpm prunecommand. :-(