How to get project's data from packages.drupal.org
-
19-01-2021 - |
Question
Drupal projects can be searched similarly as Packagist:
- https://packages.drupal.org/8/search.json?s=projectname
- https://packagist.org/search.json?q=projectname
From Packagist can be also extrated the project's data (e.g. versions):
Is it possible to get project's data also from the Drupal repository?
More info:
La solution
Yes, the Composer documentation on repositories describes this mechanism, specifically, the provider-includes
and providers-url
properties.
These properties describe the package indexes & the URL pattern used for look up, for example:
- https://packages.drupal.org/8/packages.json (root index)
- https://packages.drupal.org/8/drupal/provider-2018-2%24082d3c8e1745428fcd819891137e88683576066b00ed52bd80811943e98e8d08.json (first index)
- https://packages.drupal.org/8/drupal/commerce%24f8b852956418601bb4d985203d4138a18e2bfc0ae1b67b249a667228190fd26f.json (a specific package with all its releases)
Licencié sous: CC-BY-SA avec attribution
Non affilié à drupal.stackexchange