Socket
Socket
Sign inDemoInstall

github-url-to-object

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-url-to-object - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

2

package.json
{
"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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc