Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:25
What would you like to do?
get name repository from url github
//get name github url from javascript
var repo_url = ""; //obtain => flux
var name = repo_url.replace(/http(?:s|)\:\/\/(?:www\.|)github\.com\/(?:.*?)\/(.*?)/, "$1")
console.log(name); // flux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment