LookAtMySuitBot/js/node_modules/git-up
Brett 5f2b208d42 c++ setup 2023-12-24 20:08:39 -05:00
..
example c++ setup 2023-12-24 20:08:39 -05:00
lib c++ setup 2023-12-24 20:08:39 -05:00
test c++ setup 2023-12-24 20:08:39 -05:00
.npmignore c++ setup 2023-12-24 20:08:39 -05:00
CONTRIBUTING.md c++ setup 2023-12-24 20:08:39 -05:00
LICENSE c++ setup 2023-12-24 20:08:39 -05:00
README.md c++ setup 2023-12-24 20:08:39 -05:00
package.json c++ setup 2023-12-24 20:08:39 -05:00

README.md

git-up PayPal Version Downloads Get help on Codementor

A low level git url parser.

Installation

$ npm i --save 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.

Where is this library used?

If you are using this library in one of your projects, add it in this list.

License

MIT © Ionică Bizău