
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
parse-git-url
Advanced tools
The parse-git-url npm package is a utility for parsing Git URLs into their component parts. It supports various Git URL formats and provides a simple interface to extract information such as the protocol, host, owner, name, and more.
Parse Git URL
This feature allows you to parse a Git URL and extract its components. The code sample demonstrates how to parse a Git URL and log the parsed object, which includes properties like protocol, host, owner, and name.
const parseGitUrl = require('parse-git-url');
const parsed = parseGitUrl('https://github.com/user/repo.git');
console.log(parsed);
Support for Different Git URL Formats
This feature shows the package's ability to handle different Git URL formats, such as SSH and HTTPS. The code sample demonstrates parsing both an SSH URL and an HTTPS URL, logging the parsed objects for each.
const parseGitUrl = require('parse-git-url');
const sshUrl = parseGitUrl('git@github.com:user/repo.git');
const httpsUrl = parseGitUrl('https://github.com/user/repo.git');
console.log(sshUrl);
console.log(httpsUrl);
Extract Specific Components
This feature allows you to extract specific components from a parsed Git URL. The code sample demonstrates how to extract and log the owner and repository name from a parsed Git URL.
const parseGitUrl = require('parse-git-url');
const parsed = parseGitUrl('https://github.com/user/repo.git');
const owner = parsed.owner;
const name = parsed.name;
console.log(`Owner: ${owner}, Repo Name: ${name}`);
The git-url-parse package provides similar functionality to parse-git-url, allowing you to parse Git URLs and extract their components. It also supports various Git URL formats and offers additional methods for manipulating and formatting Git URLs.
The parse-url package is a more general-purpose URL parser that can handle Git URLs among other types of URLs. It provides a comprehensive set of features for parsing, manipulating, and formatting URLs, making it a versatile alternative to parse-git-url.
The url-parse package is another general-purpose URL parser that can handle Git URLs. It offers a robust set of features for parsing and manipulating URLs, and it is widely used in the JavaScript ecosystem for various URL parsing needs.
A lib for parsing the URL of GitHub, GitHub Enterprise Server (ghes), GitLab, and Bitbucket repositories.
import parseGitUrl from 'parse-git-url'
parseGitUrl('https://github.com/vercel/swr'))
// => {
// type: 'github',
// owner: 'vercel',
// name: 'swr',
// branch: '',
// sha: '',
// subdir: ''
// }
parseGitUrl('https://github.example.com/vercel/swr', 'github.example.com'))
// => {
// type: 'ghes',
// owner: 'vercel',
// name: 'swr',
// branch: '',
// sha: '',
// subdir: ''
// }
parseGitUrl('https://google.com')
// => null
It supports parsing various URL schemas including SSH, branch, sha, commit, subdirectories, subgroups (GitLab), etc.
FAQs
A lib for parsing the URL of Git Repositories.
The npm package parse-git-url receives a total of 130,347 weekly downloads. As such, parse-git-url popularity was classified as popular.
We found that parse-git-url demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.