{"name":"is-relative-url","version":"4.1.0","description":"Check if a URL is relative","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-relative-url.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","sideEffects":false,"engines":{"node":">=14.16"},"scripts":{"//test":"xo && ava && tsd","test":"ava && tsd"},"keywords":["url","relative","absolute","uri","is","check"],"dependencies":{"is-absolute-url":"^4.0.1"},"devDependencies":{"ava":"^4.3.0","tsd":"^0.20.0","xo":"^0.49.0"},"_id":"is-relative-url@4.1.0","gitHead":"2cfc1d54714e84432f074ae2844ce99e71978b00","bugs":{"url":"https://github.com/sindresorhus/is-relative-url/issues"},"homepage":"https://github.com/sindresorhus/is-relative-url#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-vhIXKasjAuxS7n+sdv7pJQykEAgS+YU8VBQOENXwo/VZpOHDgBBsIbHo7zFKaWBjYWF4qxERdhbPRRtFAeJKfg==","shasum":"fe8efb2616b272cf141d3c9de9760594e53453a7","tarball":"http://registry-npm.ywwl.com/is-relative-url/download/is-relative-url-4.1.0.tgz","fileCount":5,"unpackedSize":5012,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCm7qL8hh0r+fc5MosWyAk0sGiM9S1UxYMBRMKUTUHvlwIgJFLa+7LROg0dBGC2qmllVPy31CIGBjMzXJfZaQoLc/4="}],"size":2194,"noattachment":false,"key":"/is-relative-url/-/is-relative-url-4.1.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/is-relative-url_4.1.0_1757501878468_0.9645864111764497"},"_hasShrinkwrap":false,"readme":"# is-relative-url\n\n> Check if a URL is relative\n\n## Install\n\n```sh\nnpm install is-relative-url\n```\n\n## Usage\n\n```js\nimport isRelativeUrl from 'is-relative-url';\n\nisRelativeUrl('foo/bar');\n//=> true\n\nisRelativeUrl('https://sindresorhus.com/foo/bar');\n//=> false\n\nisRelativeUrl('//sindresorhus.com');\n//=> true\n```\n\n## API\n\n### isRelativeUrl(url, options?)\n\n#### url\n\nType: `string`\n\nThe URL to check.\n\n#### options\n\nType: `object`\n\n##### allowProtocolRelative\n\nType: `boolean`\\\nDefault: `true`\n\nAllow [protocol-relative URLs](https://en.wikipedia.org/wiki/URL#Protocol-relative_URLs) (e.g., `//example.com`) to be considered relative.\n\nSetting this to `false` will treat protocol-relative URLs as absolute, which can be useful for security purposes when you want to ensure a URL won't redirect to an external domain.\n\n> [!NOTE]\n> Protocol-relative URLs are [technically relative](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2) according to [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986), as they require the current page's protocol to resolve into absolute URLs. However, they can still navigate to external domains, which may be a security concern in certain contexts (e.g., preventing open redirects).\n\n## Related\n\nSee [is-absolute-url](https://github.com/sindresorhus/is-absolute-url) for the inverse.\n","publish_time":1757501878656,"_cnpm_publish_time":1757501878656,"dist-tags":{"latest":"4.1.1"}}