Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
normalize-git-url
Advanced tools
You have a bunch of Git URLs. You want to convert them to a canonical representation, probably for use inside npm so that it doesn't end up creating a bunch of superfluous cached origins. You use this package.
var ngu = require('normalize-git-url');
var normalized = ngu("git+ssh://git@github.com:organization/repo.git#hashbrowns")
// get back:
// {
// url : "ssh://git@github.com/organization/repo.git",
// branch : "hashbrowns" // did u know hashbrowns are delicious?
// }
There's just the one function, and all it takes is a single parameter, a non-normalized Git URL.
url
{String} The Git URL (very loosely speaking) to be normalized.Returns an object with the following format:
url
{String} The normalized URL.branch
{String} The treeish to be checked out once the repo at url
is
cloned. It doesn't have to be a branch, but it's a lot easier to intuit what
the output is for with that name.Right now this doesn't try to special-case GitHub too much -- it doesn't ensure
that .git
is added to the end of URLs, it doesn't prefer https:
over
http:
or ssh:
, it doesn't deal with redirects, and it doesn't try to
resolve symbolic names to treeish hashcodes. For now, it just tries to account
for minor differences in representation.
FAQs
Normalizes Git URLs. For npm, but you can use it too.
The npm package normalize-git-url receives a total of 35,832 weekly downloads. As such, normalize-git-url popularity was classified as popular.
We found that normalize-git-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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.