Skip to content

jonathantneal/location.parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

location.parse

location.parse parses a URL in a string into a location-like object.

location.parse("https://example.com:443/video.m4v?whats=the+story#morning-glory");
{
    "href": "https://example.com:443/video.m4v?whats=the+story#morning-glory",
    "protocol": "https:",
    "host": "example.com",
    "port": 443,
    "pathname": "/movie.m4v",
    "search": "?whats=the+story",
    "hash": "#morning-glory"
}

The script is 1.2KB, or 413B minified + gzipped.

About

Parse any string for a URL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published