How to check if library is present in vendor folder?
If you are talking about libraries, which are defined in files like *.libraries.yml, then you can use this:

\Drupal::service('library.discovery')-&gt;getLibraryByName('MODULE_NAME', 'LIBRARY_NAME')


You'll receive an array with all data including paths to check that files are exist.