Bower is it still useful?

Or why we need to stop cloning NPM

Yacine Rezgui
Dev Rocket

--

Most of the front end developers already know Bower. It’s a front packages manager like NPM for NodeJS, Gems for Ruby and Pip for Python. It’s created by the developers of Twitter.

For many people, there was a need to don’t pollute the NPM directory because it’s for NodeJS and NodeJS is back end only…

Well in the beginning, it wasn’t false to say that but now, with Browserify, Node shows that it’s environment agnostic.

So what Bower has different from NPM? Honestly, not very much. You can set more than one main file, and they don’t have to be JavaScript nor following CommonJS specification, the developer knows which files are important in each dependency of his project and can run some build tasks more easily.

That’s it…

There is a need for CSS, fonts only libraries, but it’s not a big modification to add to NPM for having the same feature.

I didn’t face the problem of duplication until this small project I’m working on. I needed to host it on Heroku, the backend and the static files (I was lazy to upload them on Amazon S3). So I had to add it as a dependency.

I had a look to the bower directory and I saw that :

  • 15.9 MB
  • 41 dependencies (+ 11 dev dependencies)

What the hell? For the same job as NPM, Bower is so heavy! NPM is as big as Bower too, but it’s already embedded with NodeJS and for only getting some front libraries, it costs too much.

In my case, I just added them manually to my build task. After installing NPM packages, it will run gulp :

“scripts”: {
“postinstall”: “./node_modules/gulp/bin/gulp.js”
}

So, what do you think? Do we have to use NPM or Bower is still needed?

For a complete guide on package managers, have a look to this wonderful article : http://tech.pro/tutorial/1190/package-managers-an-introductory-guide-for-the-uninitiated-front-end-developer

--

--

Yacine Rezgui
Dev Rocket

🇫🇷🇹🇳 Developer Relations Engineer 🥑 on Android working on privacy @Google in London. Hacking projects on free time