Package Exports
- parse-url
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (parse-url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
parse-url

An advanced url parser supporting git urls too.
Installation
$ npm i --save parse-urlExample
// Dependencies
var ParseUrl = require("parse-url");
console.log(ParseUrl("http://ionicabizau.net/blog"));
// => {
// protocols: [ "http" ]
// , port: null
// , resource: "ionicabizau.net"
// , user: ""
// , pathname: "/blog"
// , hash: ""
// , search: ""
// , href: "http://ionicabizau.net/blog"
// }
console.log(ParseUrl("http://domain.com/path/name?foo=bar&bar=42#some-hash"));
// => {
// protocols: ["http"]
// , port: null
// , resource: "domain.com"
// , user: ""
// , pathname: "/path/name"
// , hash: "some-hash"
// , search: "foo=bar&bar=42"
// , href: "http://domain.com/path/name?foo=bar&bar=42#some-hash"
// }
console.log(ParseUrl("git+ssh://git@host.xz/path/name.git"));
// => {
// protocols: ["git", "ssh"]
// , port: null
// , resource: "host.xz"
// , user: "git"
// , pathname: "/path/name.git"
// , hash: ""
// , search: ""
// }
console.log(ParseUrl("git@github.com:IonicaBizau/git-stats.git"));
// => {
// protocols: []
// , port: null
// , resource: "github.com"
// , user: "git"
// , pathname: "/IonicaBizau/git-stats.git"
// , hash: ""
// , search: ""
// , href: "git@github.com:IonicaBizau/git-stats.git"
// }Documentation
ParseUrl(url)
Parses the input url.
Params
- String
url: 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.
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. ✨
hubot-will-it-connectby gambthomicrobe.jsby Brandon Dailtumblr-textby cobaimelan