NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack [closed]

Webpack and Browserify Webpack and Browserify do pretty much the same job, which is processing your code to be used in a target environment (mainly browser, though you can target other environments like Node). Result of such processing is one or more bundles – assembled scripts suitable for targeted environment. For example, let’s say you … Read more

Do I commit the package-lock.json file created by npm 5?

Yes, package-lock.json is intended to be checked into source control. If you’re using npm 5+, you may see this notice on the command line: created a lockfile as package-lock.json. You should commit this file. According to npm help package-lock.json: package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. … Read more

What’s the difference between dependencies, devDependencies and peerDependencies in npm package.json file?

Summary of important behavior differences: dependencies are installed on both: npm install from a directory that contains package.json npm install $package on any other directory devDependencies are: also installed on npm install on a directory that contains package.json, unless you pass the –production flag (go upvote Gayan Charith’s answer), or if the NODE_ENV=production environment variable … Read more

What is the –save option for npm install?

Update npm 5: As of npm 5.0.0, installed modules are added as a dependency by default, so the –save option is no longer needed. The other save options still exist and are listed in the documentation for npm install. Original answer: Before version 5, NPM simply installed a package under node_modules by default. When you … Read more