Documentation from npm for npm install <package-name> --save
and npm install <package-name> --save-dev
can be found here:
https://docs.npmjs.com/getting-started/using-a-package.json#the-save-and-save-dev-install-flags
A package.json
file declares metadata about the module you are developing. Both aforementioned commands modify this package.json
file. --save
will declare the installed package (in this case, grunt
) as a dependency for your module; --save-dev
will declare it as a dependency for development of your module.
Ask yourself: will the installed package be required for use of my module, or will it only be required for developing it?