1 # url-parse-lax [![Build Status](https://travis-ci.org/sindresorhus/url-parse-lax.svg?branch=master)](https://travis-ci.org/sindresorhus/url-parse-lax)
3 > [`url.parse()`](https://nodejs.org/docs/latest/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost) with support for protocol-less URLs & IPs
9 $ npm install --save url-parse-lax
16 var urlParseLax = require('url-parse-lax');
18 urlParseLax('sindresorhus.com');
24 host: 'sindresorhus.com',
26 hostname: 'sindresorhus.com',
32 href: 'http://sindresorhus.com/'
36 urlParseLax('[2001:db8::]:8000');
42 host: '[2001:db8::]:8000',
44 hostname: '2001:db8::',
50 href: 'http://[2001:db8::]:8000/'
55 And with the built-in `url.parse()`:
58 var url = require('url');
60 url.parse('sindresorhus.com');
72 pathname: 'sindresorhus',
78 url.parse('[2001:db8::]:8000');
90 pathname: '[2001:db8::]:8000',
91 path: '[2001:db8::]:8000',
92 href: '[2001:db8::]:8000'
100 MIT © [Sindre Sorhus](http://sindresorhus.com)