{"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":{"integrity":"sha512-nb/3+jhgBfN5r9RAGTDzHAXLjmFsAJjPfwaLeI3GOlMj0iUT8wlxNw7KEDfUpoZGdTquT3jDEBxay3fKvkKc6w==","shasum":"0e39cb7b3bfbcae2a9600b309aed8af52f2237bb","tarball":"http://registry-npm.ywwl.com/url-parse-lax/download/url-parse-lax-5.0.0.tgz","fileCount":4,"unpackedSize":4524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEanNCRA9TVsSAnZWagAAue4P/RROCGg/rpXvbdrN9Kxu\nOqfRmbXGNBqVdjN2cpq4AKi6oUWvrnCEqup6SY9O1XQcvzkZHAOHCcv5rcWD\nspQyQat+8jsfl3atfXCcU481fCetkp/02FNVg7QhHxpBO1jUwsk7JfHiZ6sn\nr8w5hIKR4fndI3070vDQPOUZBrrVUb6n85XJ9kwJSMwZVSRYu757P5WRkyOS\nQvYUDCDGedUW0a+OAblE5QX6BWiuUtWiWfUJ+UpKkrUBvqtZdn7v3W4RomGf\ndVc0kAzO0UeGPdq4OKIMQL1T7789iRxvZH5+KBy3Ds7x2b040nMOPxR5EoPy\nlQxL1/ZedSh0dz4kJTis7RomPrhrWweFLl2IUp07Hee+JtS2DvZDmukHo+6d\nZrRtg77inkUCh2913LKx98/mZc8OJqpXz/CPNBoN4DezgVSEd0jexNZVbaKJ\njjsj5v2fp2YagiZILkQ6K67VoRbBbqe8hlfZDOiItt/upynGWHYKIjbva1XM\nLwKptZMVv+LU0yJ7T1K0h6rVYxVgmjvWJqZFSHO7sTdtMszkeo39bFtgG+1G\n3nwwNs1EUVk9l+XX4C1Kv3oTps+cPAlwdasdz0iBDOLttRPxoaLuXh+mAeS5\ns9GSnChHQ37eC8shFPWo0HCGE+kFFNV19YlDYoNnm9e1wonimE5GmVqEt+1Y\nW9nB\r\n=khnj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFIDi/201HQyq5m0feonLKPsDK/kyJyRMHPzKPhnLttxAiEAgvfwxHgpDnICM2pZJ1xF0CVwGWpIaHEB7EMS/53KVO0="}],"size":2163,"noattachment":false,"key":"/url-parse-lax/-/url-parse-lax-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/url-parse-lax_5.0.0_1628547532912_0.835044027820278"},"_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","publish_time":1628547533089,"_cnpm_publish_time":1628547533089,"dist-tags":{"latest":"6.0.0"}}