Liam
Liam

Reputation: 2837

What is the difference between npm 3 vs Bower?

With npm 3 coming with a flat(-ish) dependency structure, do we use Bower in future or just npm 3 when its released ?

npm is most commonly used for managing Node.js modules, but it works for the front-end too when combined with Browserify and/or $ npm dedupe.

Bower is created solely for the front-end and is optimized with that in mind. The biggest difference is that npm does nested dependency tree (size heavy) while Bower requires a flat dependency tree (puts the burden of dependency resolution on the user)

merge bower into npm

npm3

npm-and-front-end-packaging

Upvotes: 6

Views: 1650

Answers (2)

Sachin
Sachin

Reputation: 3540

  • Bower is mainly for frontend libraries, which do not have dependencies of their own, thus in bower, flat structure is a limitation, rather than a feature.

  • npm-3 is a smart dependency manager where dependencies can have their own secondary dependencies (sub-dependencies).

  • It tries to create flattened structure wherever possible, but that is not a limitation. In certain cases, it will not adhere it (for example : when you need multiple version of a dependency)

Upvotes: 1

PowerKiKi
PowerKiKi

Reputation: 4738

npm 3 coupled with browserify or webpack is the way to go now. Multiplying package manager in your project make your workflow harder.

Install npm 3 today with:

npm install -g npm@latest

Upvotes: 6

Related Questions