Today I learned

Use Bower packages like npm packages

Update (Jan 2019): Bower hasn't been maintained for years, and using Bower packages should now be considered a discouraged practice.

Napa is a package that lets you install arbitrary projects (without package.json) into node_modules. Bower packages are repos without package.json manifests. Hence, you can use Napa to use Bower packages as if they were npm packages... sort of.

  "scripts": {
    "install": "napa"  },
  "napa": {
    "hint": "chinchang/hint.css#v1.3.1",    "colorbox": "jackmoore/colorbox#1.5.9"  }

Promising idea, but I'd like to see it developed more. Some caveats as of 1.2.0:

  • not compatible with npm shrinkwrap
  • upgrading packages are not automatic

You have just read Use Bower packages like npm packages, written on February 23, 2015. This is Today I Learned, a collection of random tidbits I've learned through my day-to-day web development work. I'm Rico Sta. Cruz, @rstacruz on GitHub (and Twitter!).

← More articles