How can I extract the user, repo, and path from a Github URL pasted into a form in order to make API requests? For example, https://github.com/HubSpot/BuckyClient/blob/master/README.md
I have started working on a regex solution to locate the different parts of the URL, but this approach seems fragile as there are various formats of Github URLs.
Is there an API method available that I am unaware of, such as getRepoFromUrl(), or a more reliable way to extract this information from the provided URL? I am using node/javascript.
Thank you