DEV Community

Clarice Bouwer
Clarice Bouwer

Posted on

How to sort your package.json dependencies

npm r -S example; npm r -D example
Enter fullscreen mode Exit fullscreen mode

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

Thanks to this question on Stack Overflow.

Top comments (2)

Collapse
 
clumsycoder profile image
Kaushal Joshi

what do you mean by 'example'?

Collapse
 
cbillowes profile image
Clarice Bouwer

"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.