Gathering detailed insights and metrics for @pocke/github-url-to-object
Gathering detailed insights and metrics for @pocke/github-url-to-object
Gathering detailed insights and metrics for @pocke/github-url-to-object
Gathering detailed insights and metrics for @pocke/github-url-to-object
A node module that extracts useful properties like user, repo, and branch from various flavors of GitHub URLs.
npm install @pocke/github-url-to-object
Typescript
Module System
Node Version
NPM Version
71.4
Supply Chain
98.9
Quality
74.8
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
661
Last Day
1
Last Week
2
Last Month
18
Last Year
120
89 Stars
144 Commits
21 Forks
2 Watchers
3 Branches
17 Contributors
Updated on Apr 14, 2025
Minified
Minified + Gzipped
Latest Version
4.0.4
Package Id
@pocke/github-url-to-object@4.0.4
Unpacked Size
23.69 kB
Size
5.19 kB
File Count
10
NPM Version
6.1.0
Node Version
10.5.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
2
Compared to previous week
Last Month
157.1%
18
Compared to previous month
Last Year
5.3%
120
Compared to previous year
A module for node.js and browsers that extracts useful properties like user
,
repo
, and branch
from various flavors of GitHub URLs.
There's also a Bitbucket equivalent to this library: bitbucket-url-to-object.
Check out the demo at zeke.github.io/github-url-to-object.
For Node.js or Browserify usage:
1npm i github-url-to-object
For bower usage:
1bower install github-url-to-object
Use whatever flavor of GitHub URL you like:
1const gh = require('github-url-to-object') 2 3gh('github:monkey/business') 4gh('https://github.com/monkey/business') 5gh('https://github.com/monkey/business/tree/master') 6gh('https://github.com/monkey/business/tree/master/nested/file.js') 7gh('https://github.com/monkey/business.git') 8gh('http://github.com/monkey/business') 9gh('git://github.com/monkey/business.git') 10gh('git+https://github.com/monkey/business.git')
Here's what you'll get:
1{ 2 user: 'monkey', 3 repo: 'business', 4 branch: 'master', 5 tarball_url: 'https://api.github.com/repos/monkey/business/tarball/master', 6 clone_url: 'https://github.com/monkey/business', 7 https_url: 'https://github.com/monkey/business', 8 travis_url: 'https://travis-ci.org/monkey/business', 9 api_url: 'https://api.github.com/repos/monkey/business' 10 zip_url: 'https://github.com/monkey/business/archive/master.zip' 11}
The shorthand form lets you specify a branch:
1gh('github:monkey/business#nachos')
1{ 2 user: 'monkey', 3 repo: 'business', 4 branch: 'nachos', 5 https_url: 'https://github.com/monkey/business/blob/nachos', 6 tarball_url: 'https://api.github.com/repos/monkey/business/tarball/nachos', 7 clone_url: 'https://github.com/monkey/business', 8 travis_url: 'https://travis-ci.org/monkey/business?branch=nachos', 9 api_url: 'https://api.github.com/repos/monkey/business' 10 zip_url: 'https://github.com/monkey/business/archive/nachos.zip' 11}
If you provide a non-GitHub URL or a falsey value, you'll get null
.
If you're using GitHub Enterprise, pass the enterprise
option to allow
your non-github.com
URL to be parsed:
1gh('https://ghe.example.com:heroku/heroku-flags.git', { enterprise: true })
1npm install 2npm test
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 6/12 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More