Socket
Socket
Sign inDemoInstall

git-up

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-up

A low level git url parser.


Version published
Weekly downloads
3.4M
decreased by-3.42%
Maintainers
1
Weekly downloads
 
Created
Source

git-up Donate now

A low level git url parser.

Installation

$ npm i git-up

Example

// Dependencies
var GitUp = require("git-up");

console.log(GitUp("git@github.com:IonicaBizau/node-parse-url.git"));
// => {
//     protocols: []
//   , port: null
//   , resource: "github.com"
//   , user: "git"
//   , pathname: "/IonicaBizau/node-parse-url.git"
//   , hash: ""
//   , search: ""
//   , href: "git@github.com:IonicaBizau/node-parse-url.git"
//   , protocol: "ssh"
// }

console.log(GitUp("https://github.com/IonicaBizau/node-parse-url.git"));
// => {
//     protocols: [ "https" ]
//   , port: null
//   , resource: "github.com"
//   , user: ""
//   , pathname: "/IonicaBizau/node-parse-url.git"
//   , hash: ""
//   , search: ""
//   , href: "https://github.com/IonicaBizau/node-parse-url.git"
//   , protocol: "https"
// }

Documentation

GitUp(input)

Parses the input url.

Params
  • String input: The input url.
Return
  • Object An object containing the following fields:
  • protocols (Array): An array with the url protocols (usually it has one element).
  • port (null|Number): The domain port.
  • resource (String): The url domain (including subdomains).
  • user (String): The authentication user (usually for ssh urls).
  • pathname (String): The url pathname.
  • hash (String): The url hash.
  • search (String): The url querystring value.
  • href (String): The input url.
  • protocol (String): The git url protocol.
  • token (String): The oauth token (could appear in the https urls).

How to contribute

Have an idea? Found a bug? See how to contribute.

License

KINDLY © Ionică Bizău–The LICENSE file contains a copy of the license.

Keywords

FAQs

Package last updated on 06 Aug 2015

Did you know?

Socket

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.

Install

Related posts

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