K
K
krll-k2015-03-31 16:08:47
Node.js
krll-k, 2015-03-31 16:08:47

When to use --save and --save-dev in NPM?

When to use --save and --save-dev in NPM?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Kitmanov, 2015-03-31
@krll-k

Compilers-transpilers-translators (like Coffee, LESS, Jade), test runners, style checkers and linters (mocha, chai, karma, (js|es)lint, jscs), plugins for task runners (grunt-contrib- watch, gulp-jade) - all this is usually set as --save-dev, because only those who contribute to this project need to work with its code.
Libraries and frameworks (expressjs, jquery, backbone), on the basis of which your code works, without which your code will not run on its consumer, are set as --save.

T
Timur Shemsedinov, 2015-03-31
@MarcusAurelius

If you want npm to modify the dependencies in package.json, and dependencies are known to be divided into main (dependencies) and development (devDependencies). Development dependencies are installed via npm install packageName --dev and this is used for automated testing, builds, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question