DEV Community

Clarice Bouwer
Clarice Bouwer

Posted on

4 2

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.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs