How to obtain a list of JS files from enabled modules, or expose such list from a theme as library?
list_themes() returns an array of objects:

The keys are the themes' machine names and the values are objects having the following properties:

scripts: An associative array of JavaScripts, using the filename as key and the complete filepath as value. Not set if no scripts are defined in the .info file.