How to access library version details in JavaScript
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.