Alternative to libraries_get_path() to get a JavaScript file path I was crafting the following code in order to alter the path to a JavaScript file.

function MY_MODULE_js_alter(&amp;$javascript) {
      $sm_path = libraries_get_path('soundmanager2'). '/script/soundmanager2.js';
      $javascript['sites/all/libraries/soundmanager2/script/soundmanager2-nodebug-jsmin.js']['data'] = $sm_path;
      }


It works fine, but the only thing that bothers me is that libraries_get_path() is provided by the Libraries API module. Is there an internal Drupal 7 function to act the same way?
You can get the same data using drupal_get_library(), but it's not in a friendly format so you'll have to dig into the array yourself. For example, the following code will get the same path as your current code but in a much less less satisfying manner (in my opinion anyway):

$lib = drupal_get_library('soundmanager2', 'soundmanager2_debug');
$sm_path = array_shift(array_keys($lib['js']));


As I understand it this is actually the reason there's a need for the Libraries API to exist...so this sort of thing can be managed in a structured manner.