{"_id":"url-parse-lax","_rev":"518174","name":"url-parse-lax","description":"Lax `url.parse()` with support for protocol-less URLs & IPs","dist-tags":{"latest":"5.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-08-09T22:20:45.000Z","created":"2015-07-13T11:21:35.694Z","5.0.0":"2021-08-09T22:18:53.089Z","4.0.0":"2019-06-11T17:37:19.769Z","3.0.0":"2017-11-03T20:35:38.836Z","2.0.0":"2017-10-17T10:21:42.728Z","1.0.0":"2015-07-13T11:21:35.694Z"},"users":{"antixrist":true,"huhgawz":true,"gavinning":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/url-parse-lax.git"},"versions":{"5.0.0":{"name":"url-parse-lax","version":"5.0.0","description":"Lax `url.parse()` with support for protocol-less URLs & IPs","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/url-parse-lax.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava"},"keywords":["url","parse","parser","loose","lax","protocol","less","protocol-less","ip","ipv4","ipv6"],"dependencies":{"prepend-http":"^4.0.0"},"devDependencies":{"ava":"^3.15.0","xo":"^0.44.0"},"gitHead":"babb752aeb217bfe71c828b76fa75f084bcdc921","bugs":{"url":"https://github.com/sindresorhus/url-parse-lax/issues"},"homepage":"https://github.com/sindresorhus/url-parse-lax#readme","_id":"url-parse-lax@5.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"shasum":"0e39cb7b3bfbcae2a9600b309aed8af52f2237bb","size":2163,"noattachment":false,"key":"/url-parse-lax/-/url-parse-lax-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/url-parse-lax/download/url-parse-lax-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-parse-lax_5.0.0_1628547532912_0.835044027820278"},"_hasShrinkwrap":false,"publish_time":1628547533089,"_cnpm_publish_time":1628547533089},"4.0.0":{"name":"url-parse-lax","version":"4.0.0","description":"Lax url.parse() with support for protocol-less URLs & IPs","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/url-parse-lax.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava"},"keywords":["url","uri","parse","parser","loose","lax","protocol","less","protocol-less","ip","ipv4","ipv6"],"dependencies":{"prepend-http":"^3.0.1"},"devDependencies":{"ava":"^2.1.0","xo":"^0.24.0"},"gitHead":"ec2996366f094edd7d719cdb4aa0536acd2ff516","bugs":{"url":"https://github.com/sindresorhus/url-parse-lax/issues"},"homepage":"https://github.com/sindresorhus/url-parse-lax#readme","_id":"url-parse-lax@4.0.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"94f9b0dd8190e8baee1ce2049f79e5c67dc3318b","size":2192,"noattachment":false,"key":"/url-parse-lax/-/url-parse-lax-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/url-parse-lax/download/url-parse-lax-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-parse-lax_4.0.0_1560274639544_0.024723955458921143"},"_hasShrinkwrap":false,"publish_time":1560274639769,"_cnpm_publish_time":1560274639769},"3.0.0":{"name":"url-parse-lax","version":"3.0.0","description":"Lax url.parse() with support for protocol-less URLs & IPs","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/url-parse-lax.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["url","uri","parse","parser","loose","lax","protocol","less","protocol-less","ip","ipv4","ipv6"],"dependencies":{"prepend-http":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"4b0d2d310a9f39c8df88295853fe4f1a3bd13ec4","bugs":{"url":"https://github.com/sindresorhus/url-parse-lax/issues"},"homepage":"https://github.com/sindresorhus/url-parse-lax#readme","_id":"url-parse-lax@3.0.0","_shasum":"16b5cafc07dbe3676c1b1999177823d6503acb0c","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"16b5cafc07dbe3676c1b1999177823d6503acb0c","size":1993,"noattachment":false,"key":"/url-parse-lax/-/url-parse-lax-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/url-parse-lax/download/url-parse-lax-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-parse-lax-3.0.0.tgz_1509741338773_0.5627476745285094"},"directories":{},"publish_time":1509741338836,"_hasShrinkwrap":false,"_cnpm_publish_time":1509741338836},"2.0.0":{"name":"url-parse-lax","version":"2.0.0","description":"Lax url.parse() with support for protocol-less URLs & IPs","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/url-parse-lax.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["url","uri","parse","parser","loose","lax","protocol","less","protocol-less","ip","ipv4","ipv6"],"dependencies":{"prepend-http":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"a41da52ee8d9d9ec2a409cd8fa150103e2c491d5","bugs":{"url":"https://github.com/sindresorhus/url-parse-lax/issues"},"homepage":"https://github.com/sindresorhus/url-parse-lax#readme","_id":"url-parse-lax@2.0.0","_shasum":"6ba5871d586035d8b49cdae7432546b7abffbb7c","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"6ba5871d586035d8b49cdae7432546b7abffbb7c","size":1991,"noattachment":false,"key":"/url-parse-lax/-/url-parse-lax-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/url-parse-lax/download/url-parse-lax-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-parse-lax-2.0.0.tgz_1508235702647_0.7799494287464768"},"directories":{},"publish_time":1508235702728,"_cnpm_publish_time":1508235702728,"_hasShrinkwrap":false},"1.0.0":{"name":"url-parse-lax","version":"1.0.0","description":"url.parse() with support for protocol-less URLs & IPs","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/url-parse-lax.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["url","uri","parse","parser","loose","lax","protocol","less","protocol-less","ip","ipv4","ipv6"],"dependencies":{"prepend-http":"^1.0.1"},"devDependencies":{"ava":"0.0.4"},"gitHead":"1c2c7473ee75bb84a92c8aca532a6e615e531380","bugs":{"url":"https://github.com/sindresorhus/url-parse-lax/issues"},"homepage":"https://github.com/sindresorhus/url-parse-lax#readme","_id":"url-parse-lax@1.0.0","_shasum":"7af8f303645e9bd79a272e7a14ac68bc0609da73","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"7af8f303645e9bd79a272e7a14ac68bc0609da73","size":1735,"noattachment":false,"key":"/url-parse-lax/-/url-parse-lax-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/url-parse-lax/download/url-parse-lax-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1436786495694,"_cnpm_publish_time":1436786495694,"_hasShrinkwrap":false}},"readme":"# url-parse-lax\n\n> Lax [`url.parse()`](https://nodejs.org/docs/latest/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost) with support for protocol-less URLs & IPs\n\n## Install\n\n```\n$ npm install url-parse-lax\n```\n\n## Usage\n\n```js\nimport urlParseLax from 'url-parse-lax';\n\nurlParseLax('sindresorhus.com');\n/*\n{\n\tprotocol: 'https:',\n\tslashes: true,\n\tauth: null,\n\thost: 'sindresorhus.com',\n\tport: null,\n\thostname: 'sindresorhus.com',\n\thash: null,\n\tsearch: null,\n\tquery: null,\n\tpathname: '/',\n\tpath: '/',\n\thref: 'https://sindresorhus.com/'\n}\n*/\n\nurlParseLax('[2001:db8::]:8000');\n/*\n{\n\tprotocol: null,\n\tslashes: true,\n\tauth: null,\n\thost: '[2001:db8::]:8000',\n\tport: '8000',\n\thostname: '2001:db8::',\n\thash: null,\n\tsearch: null,\n\tquery: null,\n\tpathname: '/',\n\tpath: '/',\n\thref: 'http://[2001:db8::]:8000/'\n}\n*/\n```\n\nAnd with the built-in `url.parse()`:\n\n```js\nimport url from 'url';\n\nurl.parse('sindresorhus.com');\n/*\n{\n\tprotocol: null,\n\tslashes: null,\n\tauth: null,\n\thost: null,\n\tport: null,\n\thostname: null,\n\thash: null,\n\tsearch: null,\n\tquery: null,\n\tpathname: 'sindresorhus',\n\tpath: 'sindresorhus',\n\thref: 'sindresorhus'\n}\n*/\n\nurl.parse('[2001:db8::]:8000');\n/*\n{\n\tprotocol: null,\n\tslashes: null,\n\tauth: null,\n\thost: null,\n\tport: null,\n\thostname: null,\n\thash: null,\n\tsearch: null,\n\tquery: null,\n\tpathname: '[2001:db8::]:8000',\n\tpath: '[2001:db8::]:8000',\n\thref: '[2001:db8::]:8000'\n}\n*/\n```\n\n## API\n\n### urlParseLax(url, options?)\n\n#### url\n\nType: `string`\n\nThe URL to parse.\n\n#### options\n\nType: `object`\n\n##### https\n\nType: `boolean`\\\nDefault: `true`\n\nPrepend `https://` instead of `http://` to protocol-less URLs.\n\n## Related\n\n- [url-format-lax](https://github.com/sindresorhus/url-format-lax) - Lax `url.format()` that formats a hostname and port into IPv6-compatible socket form of `hostname:port`\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-url-parse-lax?utm_source=npm-url-parse-lax&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","_attachments":{},"homepage":"https://github.com/sindresorhus/url-parse-lax#readme","bugs":{"url":"https://github.com/sindresorhus/url-parse-lax/issues"},"license":"MIT"}