
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
parse-github-repo-url
Advanced tools
The parse-github-repo-url npm package is a utility for parsing GitHub repository URLs into their constituent parts, such as the owner, repository name, and branch. This can be useful for applications that need to handle GitHub URLs and extract meaningful information from them.
Parse GitHub Repository URL
This feature allows you to parse a GitHub repository URL and extract the owner and repository name. If a branch is specified in the URL, it will also be extracted.
const parse = require('parse-github-repo-url');
const result = parse('https://github.com/user/repo');
console.log(result); // ['user', 'repo', '']
Parse GitHub Repository URL with Branch
This feature allows you to parse a GitHub repository URL that includes a branch. The owner, repository name, and branch will be extracted.
const parse = require('parse-github-repo-url');
const result = parse('https://github.com/user/repo/tree/branch');
console.log(result); // ['user', 'repo', 'branch']
The github-url-to-object package converts GitHub URLs into objects containing useful information such as the user, repository, and branch. It offers more detailed parsing and additional properties compared to parse-github-repo-url.
The parse-github-url package is another utility for parsing GitHub URLs. It provides similar functionality to parse-github-repo-url but includes additional features like extracting the protocol and host.
The github-url-parse package parses GitHub URLs and returns an object with properties like owner, name, branch, and more. It offers a more comprehensive parsing compared to parse-github-repo-url.
Parse all the stupid ways you could write a GitHub URL in your damn package.json
.
Supports:
<user>/<repo#<commit>
git://
and .git
w/ #commit
or @version
version
could be false
y, a semantic version, a commit, or a branch, etc.
var parse = require('parse-github-repo-url')
parse('component/emitter#1') // => ['component', 'emitter', '1']
See the tests for all the different types of supported URLs.
FAQs
Parse a GitHub URL for user/project@version
The npm package parse-github-repo-url receives a total of 586,937 weekly downloads. As such, parse-github-repo-url popularity was classified as popular.
We found that parse-github-repo-url demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.