How to sort your package.json dependencies

Estimated 1 minute read · Monday, 18 April 2022
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.

We use essential cookies to make our site work. With your consent, we may also use non-essential cookies to improve user experience and analyze website traffic. By clicking 'Accept', you agree to our website's cookie use as described in our Privacy Policy.