{"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","tarball":"http://registry-npm.ywwl.com/url-parse-lax/download/url-parse-lax-2.0.0.tgz","integrity":"sha512-Pg+bA5tKMtq7OjgggbhNeyFlRtGyKJvGXHl+Wh2Ykr4njfcjzVJ9mrb8f0bnYiZ33lT8+QdGhEZEdKkDsUjn3Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHTbS6bofO4Y4h5VqVQbXMu4FA8i/Vs7FGFQ++fAua9hAiEAuTUYbW8CLjVtWVhFYBvvE6HglQ174SwKeVKU1LnJofk="}],"size":1991,"noattachment":false,"key":"/url-parse-lax/-/url-parse-lax-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-parse-lax-2.0.0.tgz_1508235702647_0.7799494287464768"},"directories":{},"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","publish_time":1508235702728,"_cnpm_publish_time":1508235702728,"dist-tags":{"latest":"6.0.0"}}