How to access library version details in JavaScript I have a theme with library file looks like this:

global:
  version: 1.0.0
  js:
    js/global.js: {}


global.js has some functionality specific to version 1.0.0. 

Is there anyway to get this version number? Is it available in JS?
Library definitions can be accessed via the library.discovery service (LibraryDiscovery).

$libraryDiscovery = \Drupal::get('library.discovery');
// Where mytheme is the name of your theme.
$definition = $libraryDiscovery-&gt;getLibraryByName('mytheme/global');


Then you would need to pull out $definition['version'] into a JavaScript settings or do something with it in your theme.