github-url-to-object
Advanced tools
Comparing version 0.4.0 to 0.4.1
{ | ||
"name": "github-url-to-object", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Extract username and repo name from various flavors of GitHub URLs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,7 +13,25 @@ # github-url-to-object | ||
Pass whatever flavor of github URL you like: | ||
```js | ||
require('github-url-to-object')('https://github.com/foo/bar.git'); | ||
// -> {user: 'foo', repo: 'git'} | ||
var gh = require('github-url-to-object') | ||
gh('user/repo') | ||
gh('https://github.com/monkey/business') | ||
gh('https://github.com/monkey/business.git') | ||
gh('http://github.com/monkey/business') | ||
gh('git://github.com/monkey/business.git') | ||
``` | ||
Here's what you'll get back: | ||
```js | ||
{ | ||
user: 'monkey', | ||
repo: 'business' | ||
} | ||
``` | ||
If you provide a non-github URL or a falsy value, you'll get `null` back. | ||
## Test | ||
@@ -23,12 +41,6 @@ | ||
npm test | ||
``` | ||
✓ extracts username and repo from github URL | ||
✓ handles URLs without .git at the end | ||
✓ handles http URLs | ||
✓ handles https URLs | ||
✓ handles git URLs | ||
✓ handles shorthand user/repo paths | ||
``` | ||
## License | ||
WTFPL | ||
WTFPL |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3498
45