bower info <thepackagename>
bower info apackageIdonthaveinstalled
cat bower_components/thepackagename/bower.json | node_modules/json/lib/json.js version
The best approach I've now found, which seems to work for every package I've come across so far, is:
cat bower_components/thepackagename/.bower.json | node_modules/json/lib/json.js version
(note the extra
It would appear that bower stores some metadata about the installed package in
.bower.json, and that includes the installed version.
The best I've come up with so far is:
bower list | grep jquery | perl -pe 's/.*jquery#(.*?) .*$/$1/'
(if, for example, the package I was interested in was
That's pretty ugly for a variety of reasons:
I have to repeat the package name (although this could probably be improved with a better Perl script which filters lines too, I'm just being lazy).
bower list gets information about all installed packages, not just the one I'm interested in - the rest of the information is discarded.
bower list seems to require internet connectivity to check the registry, otherwise it fails.
Would be interested to see if this could be improved upon, particularly the last point.