How can I get hold of the Composer object in Drupal code?

I’m trying to get the file location of something in an installed package.

https://stackoverflow.com/questions/15714809/get-filesystem-path-of-installed-composer-package says I can get that from the Composer object.

But in Drupal, how do I get the Composer object?