I'm late to the party, but none of the answers / plugins suit me (I wanted to do this without a plugin). If Cordoba has a way to get the version through Cordoba. * Api, Then I did not see this documentation anywhere, so I came up with a different method.
Before creating the application, I automatically create the www/version.js file and include it in my index.html application:
cat config.xml \ | grep '^<widget' \ | sed -E 's|^.*version="([^"]+)".*|var cordova_app_version = "\1";|' \ > www/version.js
You can then access your version of the application using the global variable cordova_app_version .
Please note that I do this in my Makefile project, which controls the entire building / launch, so this step is automated every time I make an assembly. Obviously, you will need to configure make / bash with cat / grep / sed.
source share