{"_id":"is-absolute-url","_rev":"4298139","name":"is-absolute-url","description":"Check if a URL is absolute","dist-tags":{"latest":"5.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-04-07T21:03:46.000Z","created":"2014-06-29T19:20:33.967Z","5.0.0":"2025-09-13T08:03:19.588Z","4.0.1":"2021-08-11T14:21:05.948Z","4.0.0":"2021-08-10T23:00:16.519Z","3.0.3":"2019-09-29T05:38:04.716Z","3.0.2":"2019-09-13T04:10:19.096Z","3.0.1":"2019-08-18T11:54:56.452Z","3.0.0":"2019-04-06T07:24:56.984Z","2.1.0":"2016-12-11T16:54:12.315Z","2.0.0":"2015-07-03T12:23:23.331Z","1.0.0":"2014-08-13T19:20:55.296Z","0.1.0":"2014-06-29T19:20:33.967Z"},"users":{"sixertoy":true,"rocket0191":true,"shivayl":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-absolute-url.git"},"versions":{"5.0.0":{"name":"is-absolute-url","version":"5.0.0","description":"Check if a URL is absolute","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-absolute-url.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava"},"keywords":["url","absolute","relative","is","check"],"devDependencies":{"ava":"^6.4.1","xo":"^1.2.2"},"_id":"is-absolute-url@5.0.0","gitHead":"76c6aff8bd56c55977f37ec71a5d9562bd55ea64","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"shasum":"284b172dc39b4697f0e7f8f58bda4e84c01eb206","size":2212,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/is-absolute-url_5.0.0_1757750599403_0.5799180068901912"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-13T08:03:19.588Z","publish_time":1757750599588,"_source_registry_name":"default","_cnpm_publish_time":1757750599588},"4.0.1":{"name":"is-absolute-url","version":"4.0.1","description":"Check if a URL is absolute","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-absolute-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","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["url","absolute","relative","is","check"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"3ab19cc2e599a03ea691bcb8a4c09fa3ebb5da4f","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url#readme","_id":"is-absolute-url@4.0.1","_nodeVersion":"16.2.0","_npmVersion":"7.10.0","dist":{"shasum":"16e4d487d4fded05cfe0685e53ec86804a5e94dc","size":1904,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-4.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-absolute-url_4.0.1_1628691665781_0.996510008527417"},"_hasShrinkwrap":false,"publish_time":1628691665948,"_cnpm_publish_time":1628691665948},"4.0.0":{"name":"is-absolute-url","version":"4.0.0","description":"Check if a URL is absolute","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-absolute-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","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["url","absolute","relative","is","check"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"8a882db5d533f1bf91da12cd46da5be8768eebe3","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url#readme","_id":"is-absolute-url@4.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"shasum":"0b889189f6c0bcf705bf2c6ad784addef6d3c2ca","size":1870,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-absolute-url_4.0.0_1628636416340_0.06787151111197587"},"_hasShrinkwrap":false,"publish_time":1628636416519,"_cnpm_publish_time":1628636416519},"3.0.3":{"name":"is-absolute-url","version":"3.0.3","description":"Check if a URL is absolute","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-absolute-url.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["url","absolute","relative","uri","is","check"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"8a57ccec064d925640860674cd32e7182eeb3596","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url#readme","_id":"is-absolute-url@3.0.3","_nodeVersion":"10.16.3","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"96c6a22b6a23929b11ea0afb1836c36ad4a5d698","size":1906,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-3.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-3.0.3.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-absolute-url_3.0.3_1569735484544_0.16914353628578827"},"_hasShrinkwrap":false,"publish_time":1569735484716,"_cnpm_publish_time":1569735484716},"3.0.2":{"name":"is-absolute-url","version":"3.0.2","description":"Check if a URL is absolute","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-absolute-url.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["url","absolute","relative","uri","is","check"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"219de67a7cd8193a0ae56677930304bbe3a26638","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url#readme","_id":"is-absolute-url@3.0.2","_nodeVersion":"10.16.0","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"554f2933e7385cc46e94351977ca2081170a206e","size":1900,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-3.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-3.0.2.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-absolute-url_3.0.2_1568347818837_0.3173530606423203"},"_hasShrinkwrap":false,"publish_time":1568347819096,"_cnpm_publish_time":1568347819096},"3.0.1":{"name":"is-absolute-url","version":"3.0.1","description":"Check if a URL is absolute","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-absolute-url.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["url","absolute","relative","uri","is","check"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"305031f19aef72681a57396e687b5c11021211c0","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url#readme","_id":"is-absolute-url@3.0.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e315cbdcbbc3d6789532d591954ac78a0e5049f6","size":1697,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-3.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-absolute-url_3.0.1_1566129296322_0.2570963314369621"},"_hasShrinkwrap":false,"publish_time":1566129296452,"_cnpm_publish_time":1566129296452},"3.0.0":{"name":"is-absolute-url","version":"3.0.0","description":"Check if an URL is absolute","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-absolute-url.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["url","absolute","relative","uri","is","check"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"5170de95986994497ec74d0beeec872e80754533","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url#readme","_id":"is-absolute-url@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"eb21d69df2ed8ef72a3e6f243e216563036a0913","size":1603,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-absolute-url_3.0.0_1554535496810_0.42753297726587025"},"_hasShrinkwrap":false,"publish_time":1554535496984,"_cnpm_publish_time":1554535496984},"2.1.0":{"name":"is-absolute-url","version":"2.1.0","description":"Check if an URL is absolute","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-absolute-url.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["url","absolute","relative","uri","is","check"],"devDependencies":{"mocha":"*"},"gitHead":"d2fb33c65ae6805df1fcbfb536d122c76c0f3abb","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url#readme","_id":"is-absolute-url@2.1.0","_shasum":"50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6","size":1493,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/is-absolute-url-2.1.0.tgz_1481475250580_0.8468719229567796"},"directories":{},"publish_time":1481475252315,"_cnpm_publish_time":1481475252315,"_hasShrinkwrap":false},"2.0.0":{"name":"is-absolute-url","version":"2.0.0","description":"Check if an URL is absolute","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-absolute-url.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["url","absolute","relative","uri","is","check"],"devDependencies":{"mocha":"*"},"gitHead":"8da870b59600da38e8e42edbfb3f83e56d76c37e","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url#readme","_id":"is-absolute-url@2.0.0","_shasum":"9c4b20b0e5c0cbef9a479a367ede6f991679f359","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"9c4b20b0e5c0cbef9a479a367ede6f991679f359","size":1490,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1435926203331,"_cnpm_publish_time":1435926203331,"_hasShrinkwrap":false},"1.0.0":{"name":"is-absolute-url","version":"1.0.0","description":"Check if an URL is absolute","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/is-absolute-url"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["url","absolute","relative","uri","is","check"],"devDependencies":{"mocha":"*"},"gitHead":"aed5931a4f223339504593cb41e129512d2b7054","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url","_id":"is-absolute-url@1.0.0","_shasum":"2d7ef0fd0bb2a88dac7e92253c6808a0ace24bfb","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"2d7ef0fd0bb2a88dac7e92253c6808a0ace24bfb","size":799,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-1.0.0.tgz"},"directories":{},"publish_time":1407957655296,"_cnpm_publish_time":1407957655296,"_hasShrinkwrap":false},"0.1.0":{"name":"is-absolute-url","version":"0.1.0","description":"Check if an URL is absolute","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/is-absolute-url"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["url","absolute","relative","uri","is","check"],"devDependencies":{"mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"homepage":"https://github.com/sindresorhus/is-absolute-url","_id":"is-absolute-url@0.1.0","_shasum":"7798f8564fa87273035614420bec41f02d546cfc","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"7798f8564fa87273035614420bec41f02d546cfc","size":754,"noattachment":false,"key":"/is-absolute-url/-/is-absolute-url-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-absolute-url/download/is-absolute-url-0.1.0.tgz"},"directories":{},"publish_time":1404069633967,"_cnpm_publish_time":1404069633967,"_hasShrinkwrap":false}},"readme":"# is-absolute-url\n\n> Check if a URL is absolute\n\n## Install\n\n```sh\nnpm install is-absolute-url\n```\n\n## Usage\n\n```js\nimport isAbsoluteUrl from 'is-absolute-url';\n\nisAbsoluteUrl('https://sindresorhus.com/foo/bar');\n//=> true\n\nisAbsoluteUrl('//sindresorhus.com');\n//=> false\n\nisAbsoluteUrl('foo/bar');\n//=> false\n\nisAbsoluteUrl('javascript:alert(1)');\n//=> false\n\nisAbsoluteUrl('javascript:alert(1)', {httpOnly: false});\n//=> true\n```\n\n## API\n\n### isAbsoluteUrl(url, options?)\n\n#### url\n\nType: `string`\n\nThe URL to check.\n\n#### options\n\nType: `object`\n\n##### httpOnly\n\nType: `boolean`\\\nDefault: `true`\n\nOnly allow HTTP(S) protocols.\n\nWhen set to `false`, any valid absolute URL will be accepted, including potentially unsafe protocols like `javascript:`, `ftp:`, `ws:`, etc.\n\n> **Warning**: Setting `httpOnly` to `false` can pose security risks as it will return `true` for URLs with protocols like `javascript:`, `vbscript:`, `data:`, `ftp:`, `ws:`, etc. Only set this to `false` if you understand the implications and have appropriate safeguards in place.\n\n## Related\n\nSee [is-relative-url](https://github.com/sindresorhus/is-relative-url) for the inverse.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/is-absolute-url#readme","bugs":{"url":"https://github.com/sindresorhus/is-absolute-url/issues"},"license":"MIT"}