Casting spells
WikipediaWikipedia
Gradient background

How to sort your package.json dependencies

Clarice Bouwer

Software Engineering Team Lead and Director of Cloudsure

Monday, 18 April 2022 · Estimated 1 minute read
Copy
npm r -S example; npm r -D example

is short hand for npm remove --save anything and npm remove --save-dev whatever.

"example" is just the name of a package. You can use it verbatim because it will most likely not be in your package.json. Your packages are sorted by running npm remove even if the package "example" doesn't exist.


Thanks to this question on Stack Overflow.