NPM / Bower / Composer - differences?

Can someone explain me the difference between NPM , Bower and Composer .

These are all package managers - right?

But when do you need to use each of them?

In addition, each of them has a json file that accompanies it, does it store all the packages you need so that you can install them using the cmd line? Why is this file needed?

+69
npm bower composer-php
Apr 7 '14 at 16:53
source share
1 answer

npm - nodejs package manager. Therefore, it targets nodejs environments, which usually mean server-side nodejs projects or command-line projects (bower itself is an npm package). If you are going to do something with nodejs, then you are going to use npm.

bower is a package manager that bower on (front-end) web projects. You need npm and nodejs to install the gazebo and run it, although bower packages are not specifically designed for nodejs, but rather for the browser environment.

composer is a dependency manager that targets php projects. If you are doing something with symfony (or plain old php), this is probably the way to go

Summarizing:

  • Doing node? you do npm
  • do php? try composer
  • front-end javascript? try the gazebo

And yes, json files describe basic package information and dependencies. And yes, they are needed.

Now, what about README ?:-)

+151
Apr 07 '14 at 18:58
source share



All Articles