{"name":"url-parse-lax","version":"6.0.0","description":"Lax URL parsing with support for protocol-less URLs and 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","sideEffects":false,"engines":{"node":">=20"},"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":"^6.4.1","xo":"^1.2.2"},"_id":"url-parse-lax@6.0.0","gitHead":"94a1fb1fa625198b6cfe6f84637b6ba7c104a069","bugs":{"url":"https://github.com/sindresorhus/url-parse-lax/issues"},"homepage":"https://github.com/sindresorhus/url-parse-lax#readme","_nodeVersion":"22.12.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-4/hrYP8tlNQc0LH8K4dOPdGkM8DbbVGYr311d/BMq+fKp23aqJ5F4tQzUaWyaLOhtU0hgVwGVoi/XYNf35izrg==","shasum":"f1b3d17807cda9abb23189d7613ef3748a9f8155","tarball":"http://registry-npm.ywwl.com/url-parse-lax/download/url-parse-lax-6.0.0.tgz","fileCount":4,"unpackedSize":5241,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDgcDKx9mkRRrara5Sz8l5JV3/EUKP/3GEWqdXwMUvU3QIgJ/+jx7a+yq/ayvc7Io7QYfWIZNEWGgaXjqqaZwEUipo="}],"size":2278,"noattachment":false,"key":"/url-parse-lax/-/url-parse-lax-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/url-parse-lax_6.0.0_1757282899147_0.2669341906052667"},"_hasShrinkwrap":false,"readme":"# url-parse-lax\n\n> Lax URL parsing with support for protocol-less URLs and IPs\n\n## Install\n\n```sh\nnpm 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\tsearchParams: URLSearchParams {},\n\torigin: 'https://sindresorhus.com',\n\tusername: null,\n\tpassword: null\n}\n*/\n\nurlParseLax('[2001:db8::]:8000');\n/*\n{\n\tprotocol: 'https:',\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: 'https://[2001:db8::]:8000/',\n\tsearchParams: URLSearchParams {},\n\torigin: 'https://[2001:db8::]:8000',\n\tusername: null,\n\tpassword: null\n}\n*/\n```\n\nAnd with the built-in `url.parse()`:\n\n```js\nimport url from 'node: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.com',\n\tpath: 'sindresorhus.com',\n\thref: 'sindresorhus.com'\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) - Formats a hostname and port into IPv6-compatible socket form of `hostname:port`\n","publish_time":1757282899358,"_cnpm_publish_time":1757282899358,"dist-tags":{"latest":"6.0.0"}}