[libraries_get_libraries][1] should return an array of library directories, with the library name as the key and the directory as the value. [libraries_get_path][2] will get you the path to a specific library (js). Follwing your approach, this works fine for me: $dir = "sites/all/libraries"; $files = file_scan_directory($dir, '/.*\.js$/'); I think it might be base_path that is breaking it in your example, as it adds a `/` in front of the (relative) path from the site root. [1]: http://drupalcontrib.org/api/drupal/contributions%21libraries%21libraries.module/function/libraries_get_libraries/7 [2]: http://drupalcontrib.org/api/drupal/contributions%21libraries%21libraries.module/function/libraries_get_path/7