parse-location
v1.0.5
Published
Creates browser-esque location objects.
Downloads
20
Readme
Parse Location
Creates browser-esque location objects.
Installation
$ yarn add parse-location
Usage
import parseLocation from 'parse-location'
const location = parseLocation('http://localhost:3000/foo?bar=bar#baz')
// {
// host: 'localhost'
// hostname: 'localhost:3000'
// href: 'http://localhost:3000/foo?bar=bar#baz'
// pathname: '/foo',
// query: { bar: 'bar' },
// search: '?bar=bar',
// hash: '#baz',
// port: '3000',
// protocol: 'http:',
// }
License
MIT